pod 'Mantis', '~> 1.4.13'
let cropViewController = Mantis.cropViewController(image: ํด๋น ์ด๋ฏธ์ง (UIImage))
cropViewController.delegate = self
cropViewController.modalPresentationStyle = .fullScreen
self.present(cropViewController, animated: true, completion: nil)
extension EditImageViewController: CropViewControllerDelegate{
func cropViewControllerDidCrop(_ cropViewController: CropViewController, cropped: UIImage, transformation: Transformation) {
photoViewModel.setPhoto(currentPage, cropped)
imageView.image = photoViewModel.photos[currentPage]
dismiss(animated: true, completion: nil)
}
func cropViewControllerDidCancel(_ cropViewController: CropViewController, original: UIImage) {
dismiss(animated: true, completion: nil)
}
}
crop์ ๋๋์ฒด ๋ด๊ฐ ์ด๋ป๊ฒ ํด์ผ๋๋ ๊ณ ๋ฏผํ๋๋ฐ ์คํ์์ค๊ฐ ์์๋ค !!! Crop ๋ฟ๋ง ์๋๋ผ ํ์ , ๊ธฐ์ธ๊ธฐ๊น์ง ์ค์ ์ด ๊ฐ๋ฅํ๋ค. ์ด๋ฏธ์ง ํธ์ง ๋ผ์ด๋ธ๋ฌ๋ฆฌ Mantis ์ถ์ฒํฉ๋๋ค ๐๐ป ๐ญ