hodinkee / alexander Goto Github PK
View Code? Open in Web Editor NEWAn extremely simple JSON helper written in Swift.
License: MIT License
An extremely simple JSON helper written in Swift.
License: MIT License
Hello. Just try use swift 2 branch for project, that depend on realm, so i can not use struct
with models.
Here model looks like:
import RealmSwift
import Alexander
class NewsItem: Object, JSONDecodable {
dynamic var sid = 0
dynamic var title = ""
required init( sid: Int, title: String ) {
super.init()
self.sid = sid
self.title = title
}
required init() {
super.init()
}
static func decode(JSON: Alexander.JSON) -> Self? {
if
let sid = JSON["id"]?.int,
let title = JSON["title"]?.string {
return NewsItem(sid: sid, title: title)
}
return nil
}
}
I am still not familiar with swift, but looks similar to example code in readme.
Therefore i have error
Cannot convert return expression of type 'NewsItem' to expected return type 'Self'
Hey, I'd love to see this lib available in Swift 3 so I can implement it in my project.
Thanks ๐
I'd like to clean up the API and release a 2.0.
string
and bool
properties that use common type names to stringValue
and boolValue
DecoderType
and deprecate JSONDecodable
EncoderType
and deprecate JSONEncodable
arrayValue
and dictionaryValue
properties that expose the raw object as [AnyObject]?
and [String: AnyObject]
respectivelyA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.