Deserializer

@available(iOS 9.0, *)
public class Deserializer

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 more

    Declaration

    Swift

    public class DeserializationResult
  • Deserializes the settings file contained in the given data.

    Declaration

    Swift

    public static func deserialize(data: Data, imageDimensions: CGSize?, existingModel: PhotoEditModel? = nil) -> 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.