TransformEditController

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKTransformEditController)
open class TransformEditController : ViewController

A TransformEditController displays controls and provides gestures to edit the straighten angle, crop rectangle and orientation of an image.

  • Whether or not controls (e.g. straighten angle picker, flip button, rotate button, crop handles) should be shown. Default is true. This must be set before the view is loaded or it won’t have any effect.

    Declaration

    Swift

    open var showControls: Bool
  • Whether or not the straighten angle can be set using a rotation gesture. Default is false. This must be set before the view is loaded or it won’t have any effect.

    Declaration

    Swift

    open var canRotateUsingGesture: Bool
  • The rotation recognizer that updates the straighten angle based on rotation gestures.

    Declaration

    Swift

    open private(set) var rotationGestureRecognizer: UIRotationGestureRecognizer?
  • The container view for the scale picker.

    Declaration

    Swift

    open private(set) lazy var scalePickerContainerView: MenuAccessoryContainerView { get set }
  • The scale picker view.

    Declaration

    Swift

    open private(set) lazy var scalePicker: ScalePicker { get set }
  • The button to flip the image.

    Declaration

    Swift

    open private(set) lazy var flipButton: Button { get set }
  • The button to rotate the image.

    Declaration

    Swift

    open private(set) lazy var rotateButton: Button { get set }
  • The gradient layer that is added above the scale picker.

    Declaration

    Swift

    open private(set) lazy var gradientLayer: CAGradientLayer { get set }
  • The currently active crop rectangle in view coordinates.

    Declaration

    Swift

    open var viewCropRect: CGRect { get set }
  • Updates the crop rectangle in view and normalized image dimensions.

    Declaration

    Swift

    open func setViewCropRect(_ viewCropRect: CGRect, normalizedImageRect: CGRect, animated: Bool = false)

    Parameters

    viewCropRect

    The crop rectangle in view dimensions.

    normalizedImageRect

    The crop rectangle in normalized image dimensions.

    animated

    Whether to animate this change.

  • The currently set straighten angle.

    Declaration

    Swift

    open var straightenAngle: CGFloat { get set }
  • Updates the straighten angle.

    Declaration

    Swift

    open func setStraightenAngle(_ straightenAngle: CGFloat, animated: Bool, completion: (() -> Void)? = nil)

    Parameters

    straightenAngle

    The straighten angle.

    animated

    Whether to animate this change.

    completion

    A closure to execute after the angle changed.

  • The currently set CropAspect.

    Declaration

    Swift

    open var cropAspect: CropAspect? { get set }
  • Sets the crop aspect.

    Declaration

    Swift

    open func setCropAspect(_ cropAspect: CropAspect?, animated: Bool)

    Parameters

    cropAspect

    The crop aspect or nil for a free transform.

    animated

    Whether to animate this change.