You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letstring="""{"foo": null}"""letjson=JSON(parseJSON: string)// check if the key existsjson["foo"].exists()// true// check if the key is nulljson["bar"].type ==.null // true
Xcode 13.4.1 with SwiftUI
Given a simple JSON object (hash)
How can I check if an optional property exists?
Ex: JSON object is of type SwiftyJSON:
if(JSON.exists("myOptionalProperty") {
//DO SOMETHING
}
Either I'm missing this or it's a lacking feature.
The text was updated successfully, but these errors were encountered: