String
struct String
-
A method used to retrieve a value from a given dictionary for a specific key. - parameter dictionary: A
Dictionary
withString
keys andJSON
values. - throws:.KeyNotFound
with an associated value ofself
, whereself
is aString
, should the key not be present within theJSON
. - returns: TheJSON
value associated with the given key.Parameters
dictionary
A
Dictionary
withString
keys andJSON
values.Return Value
The
JSON
value associated with the given key.
-
An initializer to create an instance of
String
from aJSON
value. - parameter json: An instance ofJSON
. - throws: The initializer will throw an instance ofJSON.Error
if an instance ofString
cannot be created from theJSON
value that was passed to this initializer.Declaration
Swift
public init(json: JSON) throws
Parameters
json
An instance of
JSON
.