bignerdranch / Freddy

A reusable framework for parsing JSON in Swift.
MIT License
1.09k stars 119 forks source link

more complete example #184

Closed tcurdt closed 8 years ago

tcurdt commented 8 years ago

Would be nice to have an example in the docs showing this SwiftyJSON equivalent

    string = json["string"].stringValue
    int = json["int"].intValue
    double = json["double"].doubleValue
    float = json["float"].floatValue
    bool = json["bool"].boolValue
    array = json["array"].arrayObject ?? [AnyObject]()
    dictionary = json["dictionary"].dictionaryObject ?? [String: AnyObject]()
    optionalString = json["string"].string
    optionalInt = json["int"].int
    optionalDouble = json["double"].double
    optionalFloat = json["float"].float
    optionalBool = json["bool"].bool
    optionalArray = json["array"].arrayObject
    optionalDictionary = json["dictionary"].dictionaryObject
mdmathias commented 8 years ago

Thanks for the feedback. We will look for ways to improve the coverage of our examples and tutorials as we make our way to Freddy's next release. Those docs will have to be updated anyway!

In the meantime, we think that the README, Wiki, documentation, and the intro blog post cover this sort of thing pretty well.

mdmathias commented 8 years ago

Freddy's tests also include a number of examples. JSONSubscriptingTests.swift is especially useful.