Functions
The following functions are available globally.
-
Serializes a Flood object into a JSON string.
The object passed into this function can be either a
Dictionary
,Array
,String
,Bool
orDouble
. The keys of the Dictionaries must be of type String. The values of the Arrays and Dictionaries must of typeDictionary
,Array
,String
,Bool
orDouble
.Declaration
func json(from value: String, prioritizedEntries: String) -> String
Parameters
valueThe object to serialize into a JSON sttring.
prioritizedEntriesThe list of dictionary keys which should appear above other dictionary keys in the outputed string. Entries appearing earlier in the list will appear earlier in the outputed string.
Return Value
A string whose contents is the serialized JSON data.
-
Deserializes the contents of the JSON file at the specified path.
Declaration
func loadJSON(_ path: String) -> Dictionary
Parameters
pathThe relative path to the JSON file within the template.
Return Value
A dictionary containing the deserialized JSON data.