diff --git a/Swift/CropViewController/CropViewController.swift b/Swift/CropViewController/CropViewController.swift index c8a98136..65257845 100644 --- a/Swift/CropViewController/CropViewController.swift +++ b/Swift/CropViewController/CropViewController.swift @@ -95,6 +95,15 @@ open class CropViewController: UIViewController, TOCropViewControllerDelegate { */ public var image: UIImage { return self.toCropViewController.image } + /** + The minimum croping aspect ratio. If set, user is prevented from + setting cropping rectangle to lower aspect ratio than defined by the parameter. + */ + public var minimumAspectRatio: CGFloat { + set { toCropViewController.minimumAspectRatio = newValue } + get { return toCropViewController.minimumAspectRatio } + } + /** The view controller's delegate that will receive the resulting cropped image, as well as crop information. @@ -168,6 +177,15 @@ open class CropViewController: UIViewController, TOCropViewControllerDelegate { get { return toCropViewController.customAspectRatio } } + /** + If this is set alongside `customAspectRatio`, the custom aspect ratio + will be shown as a selectable choice in the list of aspect ratios. (Default is `nil`) + */ + public var customAspectRatioName: String? { + set { toCropViewController.customAspectRatioName = newValue } + get { return toCropViewController.customAspectRatioName } + } + /** Title label which can be used to show instruction on the top of the crop view controller */ @@ -418,6 +436,15 @@ open class CropViewController: UIViewController, TOCropViewControllerDelegate { get { return toCropViewController.showOnlyIcons } } + /** + Shows a confirmation dialog when the user hits 'Cancel' and there are pending changes. + (Default is NO) + */ + public var showCancelConfirmationDialog: Bool { + set { toCropViewController.showCancelConfirmationDialog = newValue } + get { return toCropViewController.showCancelConfirmationDialog } + } + /** Color for the 'Done' button. Setting this will override the default color.