SBSDKCropViewController


@interface SBSDKCropViewController : UIViewController

UIViewController subclass showing an image and a polygon The user can move edge and corner handles to redefine the polygon manually. This class cannot be instanced from a storyboard. Instead it is installing itself as a child view controller onto a given parent view controller.

Deprecated! Use SBSDKImageEditingViewControllerinstead!

  • The uncropped input image. If polygon is nil, the receiver tries to detect and set a polygon from the image. Must be called on main-thread!

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nonnull) UIImage *image;

    Swift

    var image: UIImage { get set }
  • The current polygon. If nil, the standard fully enclosing polygon is used. Must be called on main-thread!

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) SBSDKPolygon *polygon;

    Swift

    @NSCopying var polygon: SBSDKPolygon? { get set }
  • The rendered color of unsnapped edges. Must be called on main-thread!

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nonnull) UIColor *edgeColor;

    Swift

    var edgeColor: UIColor { get set }
  • The rendered color of magnetically snapped edges. Must be called on main-thread!

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nonnull) UIColor *magneticEdgeColor;

    Swift

    var magneticEdgeColor: UIColor { get set }
  • Cropped image as result of applying polygon to image. Must be called on main-thread!

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) UIImage *croppedImage;

    Swift

    var croppedImage: UIImage { get }
  • The insets of the contents: image and handles. Defaults to (12, 12, 12, 12).

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) UIEdgeInsets contentInsets;

    Swift

    var contentInsets: UIEdgeInsets { get set }
  • Delegate for result callback methods.

    Declaration

    Objective-C

    @property (readwrite, nonatomic, nullable) id<SBSDKCropViewControllerDelegate>
        delegate;

    Swift

    weak var delegate: SBSDKCropViewControllerDelegate? { get set }
  • Desginated initializer. Installs the receiver as child view controller onto the parent view controllers view using its entire bounds area.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithParentViewController:
                                (nonnull UIViewController *)parentViewController
                                           containerView:
                                               (nonnull UIView *)container;

    Swift

    init(parentViewController: UIViewController, containerView container: UIView)

    Parameters

    parentViewController

    The view controller the newly created instance is embedded into.

    container

    The view to embed the receivers view into. Must be a descendant of parentViewControllers view.

  • Tells the controller to apply changes immediately. Calls the appropriate delegate method when finished.

    Declaration

    Objective-C

    - (void)applyChanges;

    Swift

    func applyChanges()
  • Tells the controller to cancel changes immediately. Calls the appropriate delegate method.

    Declaration

    Objective-C

    - (void)dismissChanges;

    Swift

    func dismissChanges()