TextToolDelegate

public protocol TextToolDelegate : AnyObject
  • Given the point where the user tapped, return the point where a text shape should be created. You might want to set it to a specific point, or make sure it’s above the keyboard.

    Declaration

    Swift

    func textToolPointForNewText(tappedPoint: CGPoint) -> CGPoint
  • User tapped away from the active text shape. If you give users access to the selection tool, you might want to set it as the active tool at this point.

    Declaration

    Swift

    func textToolDidTapAway(tappedPoint: CGPoint)
  • The text tool is about to present a text editing view. You may configure it however you like. If you’re just starting out, you probably want to call editingView.addStandardControls() to add the delete button and the two resize handles.

    Declaration

    Swift

    func textToolWillUseEditingView(_ editingView: TextShapeEditingView)
  • The user has changed the transform of the selected shape. You may leave this method empty, but unless you want your text controls to scale with the text, you’ll need to do some math and apply some inverse scaling transforms here.

    Declaration

    Swift

    func textToolDidUpdateEditingViewTransform(_ editingView: TextShapeEditingView, transform: ShapeTransform)