AnyEditorContentDecoding

public struct AnyEditorContentDecoding<T, C> : EditorContentDecoding

A type-erased implementation of EditorContentDecoding

  • Initializes AnyEditorContentDecoding

    Declaration

    Swift

    public init<D>(_ decoder: D) where T == D.TypeToDecode, C == D.DecodingContext, D : EditorContentDecoding

    Parameters

    decoder

    Decoder to use

  • Decodes the given value to NSAttributedString

    Declaration

    Swift

    public func decode(mode: EditorContentMode, maxSize: CGSize, value: T, context: C) throws -> NSAttributedString

    Parameters

    mode

    Mode for decoding

    maxSize

    Maximum available size of the container in which the content will be rendered.

    value

    Value to decode.

    context

    Context used for decoding.