TextEditingToolController

@available(iOS 9.0, *)
open class TextEditingToolController<SpriteModelType> : PhotoEditToolController, UITextViewDelegate, ColorCollectionViewDelegate where SpriteModelType : SpriteModel

The tool controller to add or update to in image. It contains a text view and a dimming view.

  • The dimming view that dims the content behind the textView.

    Declaration

    Swift

    open private(set) lazy var dimmingView: UIView { get set }
  • The text view that is used to insert or update text.

    Declaration

    Swift

    open private(set) lazy var textView: UITextView { get set }
  • The color collection view used to display a color selection.

    Declaration

    Swift

    open private(set) lazy var colorCollectionView: ColorCollectionView { get set }
  • When this property is set, the tool will update the given SpriteModelType instead of creating a new one.

    Declaration

    Swift

    open var spriteModel: SpriteModelType?
  • Updates the text view’s properties to reflect the sprite model. Subclasses should implement this to update the view properly.

    Declaration

    Swift

    open func loadStateFromModel()
  • Creates a sprite model with the information from the text view. Subclasses should implement this method to return a proper sprite model.

    Declaration

    Swift

    open func createSpriteModelFromTextView() -> SpriteModelType?

    Return Value

    The sprite model that was created from the text view or nil.