Last active
August 4, 2017 06:34
-
-
Save NikhilManapure/ad39ec5433b7c5436210784bd6296dcc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import TOCropViewController | |
| extension EditViewController : TOCropViewControllerDelegate { | |
| func openCrop(image: UIImage) { | |
| let crop = TOCropViewController(image: image) | |
| crop.delegate = self | |
| present(crop, animated: true, completion: nil) | |
| } | |
| func cropViewController(_ cropViewController: TOCropViewController, didCropToCircleImage image: UIImage, rect cropRect: CGRect, angle: Int) { | |
| cropViewController.dismiss(animated: true, completion: { | |
| self.currentlyCapturedImage = image | |
| }) | |
| } | |
| func cropViewController(_ cropViewController: TOCropViewController, didCropToImage image: UIImage, rect cropRect: CGRect, angle: Int) { | |
| self.currentlyCapturedImage = image | |
| cropViewController.dismiss(animated: true, completion: { | |
| // | |
| }) | |
| } | |
| func cropViewController(_ cropViewController: TOCropViewController, didFinishCancelled cancelled: Bool) { | |
| cropViewController.dismiss(animated: true, completion: { | |
| // Nothing to do | |
| }) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment