SBSDKImageEditingViewController

@interface SBSDKImageEditingViewController : UIViewController

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

Replaces the deprecated SBSDKCropViewController.

  • 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 default, 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 number of clockwise rotations.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSInteger rotations;

    Swift

    var rotations: Int { get set }
  • The rendering color of non-snapped edges. Must be called on main-thread!

    Declaration

    Objective-C

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

    Swift

    var edgeColor: UIColor { get set }
  • The rendering 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 }
  • The cropped and rotated image. This is the final result of the receiver. 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<SBSDKImageEditingViewControllerDelegate>
            delegate;

    Swift

    weak var delegate: SBSDKImageEditingViewControllerDelegate? { 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.

  • Asks the controller to rotate input image

    Declaration

    Objective-C

    - (void)rotateInputImageClockwise:(BOOL)clockwise animated:(BOOL)animated;

    Swift

    func rotateInputImageClockwise(_ clockwise: Bool, animated: Bool)

    Parameters

    clockwise

    The rotation direction. If set YES, rotates clockwise, counterclockwise otherwise.

    animated

    If set to YES, animates the rotation.

  • Updates the navigation bars buttons of the receiver by calling the appropriate delegate functions.

    Declaration

    Objective-C

    - (void)updateNavigationBarItems;

    Swift

    func updateNavigationBarItems()
  • Updates the toolbars buttons of the receiver by calling the appropriate delegate functions.

    Declaration

    Objective-C

    - (void)updateToolBarItems;

    Swift

    func updateToolBarItems()
  • Tells the receiver to apply changes immediately. Calls the appropriate delegate method when finished.

    Declaration

    Objective-C

    - (void)applyChanges;

    Swift

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

    Declaration

    Objective-C

    - (void)dismissChanges;

    Swift

    func dismissChanges()