Serializer

@available(iOS 9.0, *)
public class Serializer

The Serializer class is used to serialize a PhotoEditModel object into a Data object.

  • Serializes a PhotoEditModel object into a Data object.

    If the model contains embedded personal assets they will be sourced from AssetCatalog.shared and downloaded if necessary. If possible use serialize(_ model: PhotoEditModel, with photo: PhotoRepresentation, includeImageData: Bool, assetCatalog: AssetCatalog, assetManager: AssetManager) instead and provide the AssetManager so that cached data can be used if available.

    Declaration

    Swift

    public static func serialize(_ model: PhotoEditModel, with photo: PhotoRepresentation, includeImageData: Bool) -> Data?

    Parameters

    model

    The model to serialize.

    photo

    A PhotoRepresentation object to pass to the serializer.

    includeImageData

    Whether to include the image data in the returned Data object.

    Return Value

    The serialized PhotoEditModel object, optionally also containing the photo.

  • Serializes a PhotoEditModel object into a Data object.

    Declaration

    Swift

    public static func serialize(_ model: PhotoEditModel, with photo: PhotoRepresentation, includeImageData: Bool, assetCatalog: AssetCatalog, assetManager: AssetManager) -> Data?

    Parameters

    model

    The model to serialize.

    photo

    A PhotoRepresentation object to pass to the serializer.

    includeImageData

    Whether to include the image data in the returned Data object.

    assetCatalog

    The AssetCatalog that is used to find personal assets that need to be embedded in the serialization.

    assetManager

    The AssetManager that is used to find personal asset data that needs to be embedded in the serialization.

    Return Value

    The serialized PhotoEditModel object, optionally also containing the photo.