Deserializer
@available(iOS 9.0, *)
@objcMembers
@objc(PESDKDeserializer)
public class Deserializer : NSObject
Wrapper class that manages deserialization of settings files and delegates work to the different implementations for each major version.
-
Contains the results of a deserialization.
See moreDeclaration
Swift
@objcMembers @objc(PESDKDeserializationResult) public class DeserializationResult : NSObject
-
Deserializes the settings file contained in the given data. If the deserialized data contains embedded personal assets they will be added to the asset catalog defined by the parameter
assetCatalog
which defaults toAssetCatalog.shared
.Declaration
Swift
public static func deserialize(data: Data, imageDimensions: CGSize?, existingModel: PhotoEditModel? = nil, assetCatalog: AssetCatalog = .shared) -> DeserializationResult
Parameters
data
The JSON settings.
imageDimensions
Pass an image size to deserialize according to it’s aspect ratio. Otherwise the size encoded in the settings will be used. If no dimensions are passed and none are encoded, deserialization will fail.
existingModel
If an existing model is given, only values present in the serialized settings will be updated. This allows applying templates during editing.
assetCatalog
If the deserialized data contains embedded personal assets they will be added to this
AssetCatalog
.Return Value
A
DeserializationResult
object. -
Deserializes the settings file contained in the given data. If the deserialized data contains embedded personal assets they will be added to
AssetCatalog.shared
.Declaration
Swift
@objc(deserializeWithData:) public static func _objCDeserialize(data: Data) -> DeserializationResult
Parameters
data
The JSON settings.
Return Value
A
DeserializationResult
object. -
Deserializes the settings file contained in the given data.
Declaration
Swift
@objc(deserializeWithData:assetCatalog:) public static func _objCDeserialize(data: Data, assetCatalog: AssetCatalog) -> DeserializationResult
Parameters
data
The JSON settings.
assetCatalog
If the deserialized data contains embedded personal assets they will be added to this
AssetCatalog
.Return Value
A
DeserializationResult
object. -
Deserializes the settings file contained in the given data. If the deserialized data contains embedded personal assets they will be added to
AssetCatalog.shared
.Declaration
Swift
@objc(deserializeWithData:imageDimensions:) public static func _objCDeserialize(data: Data, imageDimensions: CGSize) -> DeserializationResult
Parameters
data
The JSON settings.
imageDimensions
Pass an image size to deserialize according to it’s aspect ratio. Otherwise the size encoded in the settings will be used. If no dimensions are passed and none are encoded, deserialization will fail.
Return Value
A
DeserializationResult
object. -
Deserializes the settings file contained in the given data.
Declaration
Swift
@objc(deserializeWithData:imageDimensions:assetCatalog:) public static func _objCDeserialize(data: Data, imageDimensions: CGSize, assetCatalog: AssetCatalog) -> DeserializationResult
Parameters
data
The JSON settings.
imageDimensions
Pass an image size to deserialize according to it’s aspect ratio. Otherwise the size encoded in the settings will be used. If no dimensions are passed and none are encoded, deserialization will fail.
assetCatalog
If the deserialized data contains embedded personal assets they will be added to this
AssetCatalog
.Return Value
A
DeserializationResult
object. -
Deserializes the settings file contained in the given data. If the deserialized data contains embedded personal assets they will be added to
AssetCatalog.shared
.Declaration
Swift
@objc(deserializeWithData:imageDimensions:existingModel:) public static func _objCDeserialize(data: Data, imageDimensions: CGSize, existingModel: _ObjCPhotoEditModel) -> DeserializationResult
Parameters
data
The JSON settings.
imageDimensions
Pass an image size to deserialize according to it’s aspect ratio. Otherwise the size encoded in the settings will be used. If no dimensions are passed and none are encoded, deserialization will fail.
existingModel
If an existing model is given, only values present in the serialized settings will be updated. This allows applying templates during editing.
Return Value
A
DeserializationResult
object. -
Deserializes the settings file contained in the given data.
Declaration
Swift
@objc(deserializeWithData:imageDimensions:existingModel:assetCatalog:) public static func _objCDeserialize(data: Data, imageDimensions: CGSize, existingModel: _ObjCPhotoEditModel, assetCatalog: AssetCatalog) -> DeserializationResult
Parameters
data
The JSON settings.
imageDimensions
Pass an image size to deserialize according to it’s aspect ratio. Otherwise the size encoded in the settings will be used. If no dimensions are passed and none are encoded, deserialization will fail.
existingModel
If an existing model is given, only values present in the serialized settings will be updated. This allows applying templates during editing.
assetCatalog
If the deserialized data contains embedded personal assets they will be added to this
AssetCatalog
.Return Value
A
DeserializationResult
object.