Illuso is JSON encoder for swift.
let json = try! encode(CGRectZero)
print(try! json.stringify())
Illuso can encode struct, class, enum.
Any code for encoding is not required in Illuso.
Unfortunately, some of Objective-C Class (e.g. NSURL, NSDate, UIView ...) is unsupported in Illuso. (returned empty dictionary)
If you want to encode these types, can use Encodable protocol.
extension URL: Encodable {
func encode() throws -> JSON {
return try encode(self.absoluteString)
}
}
Of course Encodable can be implemented at Struct, and Class.
github "tarunon/Illuso"
.Package(url: "https://github.com/tarunon/Illuso.git", Version(0, 4, 1))
Version 4.3 supoprt Swift 3.
MIT
In swift, we may use awesome JSON decoding tools Argo, or Himotoki, but these cannot encode.
Illuso is required no coding because used Mirror, so we can use with Argo or Himotoki without conflict!!