StorageHelper
public class StorageHelper
Undocumented
-
Create empty object that conforms Zapp storage API
Declaration
Swift
public class func createEmptyZappStorage() -> [String : Any]
Return Value
Instance of the dictionary
-
Set value to Zapp storage dict for key in namespace domain
Declaration
Swift
public class func setZappData(inStorageDict storageDict: [String: Any], key: String, value: String, namespace: String?) -> (storageDict: [String: Any], succeed: Bool)
Parameters
storageDict
Dictionary where should be samve
key
The key with which to associate the value.
value
The object to store in storage.
namespace
Namespace that will be used for save item
Return Value
Zapp storage dictionary with updated values
-
Retrieve data from Zapp storage dict for key in namespace domain
Declaration
Swift
public class func getZappData(inStorageDict storageDict: [String: Any], key: String, namespace: String?) -> String?
Parameters
storageDict
Dictionary where should be samve
key
The key with which to associate the value.
namespace
Namespace that will be used for save item
Return Value
String Value represantation of the JSON if item was founded outherwise nil
-
Retrieve All Items from storage for namespace domain
Declaration
Swift
public class func getAll(inStorageDict storageDict: [String: Any], namespace: String?) -> String?
Parameters
storageDict
Dictionary where should be samve
namespace
Namespace that will be used for save item
Return Value
String Value represantation of the JSON. If namespace not nil will return all items for namespace domain, otherwise all storage items
-
Retrieve JSON string from Dictionary
Declaration
Swift
public class func getJSONStringFrom(dictionary: [String : Any]) -> String?
Parameters
dictionary
item to convert to JSON string
Return Value
JSON String if can be created, otherwise nil