Skip to content

Beyova/BeyovaJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BeyovaJSON

Travis CI Carthage Compatible CocoaPods Swift

BeyovaJSON allows any json for Coadable in Swift 4.

Installation

CocoaPods

pod 'BeyovaJSON'

Carthage

github "Beyova/BeyovaJSON"

Usage

import BeyovaJSON

Codable

Codable is added with Xcode 9, iOS 11 and Swift 4. It is used to make your data types encodable and decodable for compatibility with external representations such as JSON.

class Group: Codable {
	var title: String = "Guardians of the Galaxy"
	var members: JSON = [["name": "Star-Lord"],["name": "Groot"],["name": "Rocket"]]
	var date: Date = Date()
}
let group = Group()
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
let data = try! encoder.encode(group)
print(String(bytes: data, encoding: .utf8)!)

About

BeyovaJSON allows any json for Coadable

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published