Skip to content

nh7a/JsonObjectConvertible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsonObjectConvertible

This is yet another Swifty JSON library.

Why not SwiftyJSON

When we already have JSONSerialization in Foundation, why don't we simply use it so that we don't have to worry about bugs and compatibility issues with new version of Swift? This simple hack only adds a couple of short hands to Any?, and that's it.

Usage

let json = try? JSONSerialization.jsonObject(with: data, options: [])
if let name = json["data"][0]["from"]["name"] as? String {
  ...
}

For more sample, please check out JsonObjectConvertibleTests.swift.

Installation

Copy JsonObjectConvertible.swift into your project.

Author

Naoki Hiroshima, [email protected]

About

the simplest Swifty JSON library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages