Skip to content

Commit

Permalink
Merge pull request #541 from woxtu/missing-props
Browse files Browse the repository at this point in the history
Add missing properties
  • Loading branch information
TimOliver authored Apr 6, 2024
2 parents fbc0680 + 944748d commit d740572
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Swift/CropViewController/CropViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit d740572

Please sign in to comment.