Instance Methodorlandos-nl.ikigajson 2.2.3IkigaJSON
updateValue(_:forKey:)
Updates a key to a new value. If nil
is provided, the value will be removed.
@discardableResult mutating func updateValue(_ newValue: JSONValue?, forKey key: String) -> Bool
If the key does not exist, false
is returned. Otherwise true
will be returned
Other members in extension
Type members
init(
) Creates a new, empty JSONObject
init(buffer: ByteBuffer
) throws Parses the buffer as a JSON Object and configures this JSONObject to index and represent the JSON data
init(data: Data
) throws Parses the data as a JSON Object and configures this JSONObject to index and represent the JSON data
init(dictionaryLiteral: (String, JSONValue)...
) Creates a new JSONObject from a dictionary literal.
init?(json: JSONValue?
) static func == (lhs: JSONObject, rhs: JSONObject
) -> Bool
Instance members
var data: Data
A textual (JSON formatted) representation of this JSONObject as
Foundation.Data
var jsonBuffer: ByteBuffer
The raw textual (JSON formatted) representation of this JSONObject
var keys: [String]
A list of all top-level keys within this JSONObject
var string: String!
A JSON formatted String with the contents of this JSONObject
subscript(String
) -> JSONValue? Reads and writes the properties of this JSONObject by key.
func makeIterator(
) -> JSONObjectIterator