Skip to content

Add callbacks for when the Done button is tapped#643

Merged
TimOliver merged 1 commit intoTimOliver:mainfrom
jsahoo:didTapDone
Apr 7, 2026
Merged

Add callbacks for when the Done button is tapped#643
TimOliver merged 1 commit intoTimOliver:mainfrom
jsahoo:didTapDone

Conversation

@jsahoo
Copy link
Copy Markdown
Contributor

@jsahoo jsahoo commented Mar 14, 2026

This PR adds a delegate method and completion handler that are called when the Done button is tapped. This is useful for displaying an activity indicator or HUD while the newly cropped image is being created (as this can sometimes take a second or two with large images), or for tracking button tap analytics.

Simulator Screen Recording

Example Usage (Delegate)

func cropViewControllerDidTapDone(_ cropViewController: CropViewController) {
    // show activity indicator
}

func cropViewController(_ cropViewController: CropViewController, didCropToImage image: UIImage, withRect cropRect: CGRect, angle: Int) {
    // hide activity indicator
}

Example Usage (Completion Handler)

cropViewController.onDidTapDone = {
    // show activity indicator
}

cropViewController.onDidCropToRect = { image, cropRect, angle in
    // hide activity indicator
}

@TimOliver TimOliver merged commit f876c1f into TimOliver:main Apr 7, 2026
@TimOliver
Copy link
Copy Markdown
Owner

LGTM! Thanks so much for that Jonathan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants