文件名称:Parsing JSON in Swift
文件大小:702KB
文件格式:PDF
更新时间:2021-08-10 23:43:28
iOS JSON Swift
Parsing JSON in Swift will teach you to harness the power of Swift and give you confidence that your app can gracefully handle any JSON that comes its way. You'll learn: - How to use NSJSONSerialization to transform JSON into Swift types, and why you should avoid using AnyObject whenever you can - The dangers of forced type casting and how to avoid them - Simple strategies you can use to make your JSON deserialization more concise, readable, and elegant - Whether to return nil, empty, or throw an error when transforming JSON into an array of model objects - How to write unit tests to increase your confidence in your parser's correctness You'll go from fighting an uphill battle against an uncooperative compiler to having a JSON parser that's proven to be stable with automated tests.