ios - Proper way to parse with SwiftyJSON -


i'm using swityjson iterate through json data , parse it. it's working fine, make sure i'm using syntax correctly , efficiently. please review code below:

                if let itemdict = json[0]["artists"].dictionaryvalue {                     item in itemdict {                         if let artist: dictionary? = item.1.dictionaryvalue {                             // artist id                             if let artistid = artist?["id"] {                                 if artistid.stringvalue != nil {                                     // add value object                                 }                             }                             // title                             if let title = artist?["title"] {                                 if title.stringvalue != nil {                                     // add value object                                 }                             }                             // subtitle                             if let subtitle = artist?["subtitle"] {                                 if subtitle.stringvalue != nil {                                     // add value object                                 }                             }                             // image url                             if let imageurl = artist?["imageurl"] {                                 if imageurl.stringvalue != nil {                                     // add value object                                 }                             }                         }                     }                 } 

this new ray wenderlich has provided tutorial. try learn it. helped me lot.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -