FocusEditController

@available(iOS 9.0, *)
@objcMembers
@objc(PESDKFocusEditController)
open class FocusEditController : ViewController
extension FocusEditController: PhotoEditModelSettable
extension FocusEditController: SliderEditControllerDelegate
extension FocusEditController: PhotoPreviewControlling

A FocusEditController displays controls to update a linear or radial blur. It is supposed to be contained in a tool controller and be presented above a PhotoEditPreviewController. It can also contain a SliderEditController to present a slider to control the blur intensity.

Properties

  • The contained SliderEditController.

    Declaration

    Swift

    public let sliderEditController: SliderEditController<Slider>?
  • The BoxGradientView to update the linear blur.

    Declaration

    Swift

    open private(set) lazy var boxGradientView: BoxGradientView = {
      let boxGradientView = BoxGradientView()
      boxGradientView.alpha = 0
      boxGradientView.translatesAutoresizingMaskIntoConstraints = false
      boxGradientView.addTarget(self, action: #selector(gradientViewControlPointChanged(_:)), for: .valueChanged)
      return boxGradientView
    }()
  • The CircleGradientView to update the radial blur.

    Declaration

    Swift

    open private(set) lazy var circleGradientView: CircleGradientView = {
      let circleGradientView = CircleGradientView()
      circleGradientView.alpha = 0
      circleGradientView.translatesAutoresizingMaskIntoConstraints = false
      circleGradientView.addTarget(self, action: #selector(gradientViewControlPointChanged(_:)), for: .valueChanged)
      return circleGradientView
    }()
  • The LinearGradientView to update the linear blur.

    Declaration

    Swift

    open private(set) lazy var linearGradientView: LinearGradientView = {
      let linearGradientView = LinearGradientView()
      linearGradientView.alpha = 0
      linearGradientView.translatesAutoresizingMaskIntoConstraints = false
      linearGradientView.addTarget(self, action: #selector(gradientViewControlPointChanged(_:)), for: .valueChanged)
      return linearGradientView
    }()
  • The currently active FocusMode. Based on this the correct gradient view is shown.

    Declaration

    Swift

    open var focusMode: FocusMode { get set }
  • The photo edit model.

    Declaration

    Swift

    open var photoEditModel: PhotoEditModel { get set }
  • An object that acts as the delegate.

    Declaration

    Swift

    open weak var delegate: FocusEditControllerDelegate?

Initializers

Focus

  • Changes the active focus mode and displays the correct gradient view.

    Declaration

    Swift

    open func setFocusMode(_ focusMode: FocusMode, animated: Bool)

    Parameters

    focusMode

    The focus mode to use.

    animated

    Whether to animate the layout change.

  • This is a boxed property which exposes a Swift struct to Objective-C. This property should only be used if you are using Objective-C.

    Every invocation of the getter will return a new (temporary) object wrapping the underlying Swift struct. Boxed properties cannot be chained with the dot syntax for mutable access of nested properties in place. Use the setter with the assignment operator instead to modify boxed properties, e.g.:

    PESDKPhotoEditModel *photoEditModel = [[PESDKPhotoEditModel alloc] init];
    
    // CORRECT:
    // get boxed `AdjustmentModel`
    PESDKAdjustmentModel *adjustmentModel = photoEditModel.adjustmentModel;
    // modify boxed `AdjustmentModel`
    adjustmentModel.brightness = 0.5;
    // set modified boxed `AdjustmentModel`
    photoEditModel.adjustmentModel = adjustmentModel;
    
    // WRONG:
    photoEditModel.adjustmentModel.brightness = 0.5;
    

    Declaration

    Swift

    var boxedPhotoEditModel: _ObjCPhotoEditModel { get set }