@@ -43,7 +43,7 @@ public typealias CropViewCroppingStyle = TOCropViewCroppingStyle
4343/// @name Delegate
4444// ------------------------------------------------
4545
46- @objc public protocol CropViewControllerDelegate : NSObjectProtocol {
46+ @MainActor @ objc public protocol CropViewControllerDelegate : NSObjectProtocol {
4747 /**
4848 Called when the user has committed the crop action, and provides
4949 just the cropping rectangle.
@@ -108,7 +108,7 @@ open class CropViewController: UIViewController, TOCropViewControllerDelegate {
108108 The view controller's delegate that will receive the resulting
109109 cropped image, as well as crop information.
110110 */
111- public weak var delegate : CropViewControllerDelegate ? {
111+ public weak var delegate : ( any CropViewControllerDelegate ) ? {
112112 didSet { self . setUpDelegateHandlers ( ) }
113113 }
114114
@@ -665,7 +665,7 @@ extension CropViewController {
665665 fileprivate func setUpCropController( ) {
666666 modalPresentationStyle = . fullScreen
667667 addChild ( toCropViewController)
668- transitioningDelegate = ( toCropViewController as! UIViewControllerTransitioningDelegate )
668+ transitioningDelegate = ( toCropViewController as! ( any UIViewControllerTransitioningDelegate ) )
669669 toCropViewController. delegate = self
670670 toCropViewController. didMove ( toParent: self )
671671 }
@@ -679,28 +679,28 @@ extension CropViewController {
679679 return
680680 }
681681
682- if delegate. responds ( to: #selector( CropViewControllerDelegate . cropViewController ( _: didCropImageToRect: angle: ) ) ) {
682+ if delegate. responds ( to: #selector( ( any CropViewControllerDelegate ) . cropViewController ( _: didCropImageToRect: angle: ) ) ) {
683683 self . onDidCropImageToRect = { [ weak self] rect, angle in
684684 guard let strongSelf = self else { return }
685685 delegate. cropViewController!( strongSelf, didCropImageToRect: rect, angle: angle)
686686 }
687687 }
688688
689- if delegate. responds ( to: #selector( CropViewControllerDelegate . cropViewController ( _: didCropToImage: withRect: angle: ) ) ) {
689+ if delegate. responds ( to: #selector( ( any CropViewControllerDelegate ) . cropViewController ( _: didCropToImage: withRect: angle: ) ) ) {
690690 self . onDidCropToRect = { [ weak self] image, rect, angle in
691691 guard let strongSelf = self else { return }
692692 delegate. cropViewController!( strongSelf, didCropToImage: image, withRect: rect, angle: angle)
693693 }
694694 }
695695
696- if delegate. responds ( to: #selector( CropViewControllerDelegate . cropViewController ( _: didCropToCircularImage: withRect: angle: ) ) ) {
696+ if delegate. responds ( to: #selector( ( any CropViewControllerDelegate ) . cropViewController ( _: didCropToCircularImage: withRect: angle: ) ) ) {
697697 self . onDidCropToCircleImage = { [ weak self] image, rect, angle in
698698 guard let strongSelf = self else { return }
699699 delegate. cropViewController!( strongSelf, didCropToCircularImage: image, withRect: rect, angle: angle)
700700 }
701701 }
702702
703- if delegate. responds ( to: #selector( CropViewControllerDelegate . cropViewController ( _: didFinishCancelled: ) ) ) {
703+ if delegate. responds ( to: #selector( ( any CropViewControllerDelegate ) . cropViewController ( _: didFinishCancelled: ) ) ) {
704704 self . onDidFinishCancelled = { [ weak self] finished in
705705 guard let strongSelf = self else { return }
706706 delegate. cropViewController!( strongSelf, didFinishCancelled: finished)
0 commit comments