Swiftpack.co - Package - Beyova/BeyovaJSON

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)!)

Github

link
Stars: 9
Help us keep the lights on

Dependencies

Used By

Total: 0

Releases

0.0.7 - Apr 24, 2018