Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

json decoding and optionals

struct BlogPost: Decodable {
    let title: String
    /// Define a key as optional if it can be returned as `nil` or if it does not always exist in the JSON.
    let subtitle: String?
}
Source by www.avanderlee.com #
 
PREVIOUS NEXT
Tagged: #json #decoding #optionals
ADD COMMENT
Topic
Name
4+8 =