์๋ ํ์ธ์ ์ ๋ ํ์ฌ swift 3์ ์์ผ๋ฉฐ delegate ๋ฉ์๋๋ฅผ ํตํด ์ํ ์๋ฅด๊ธฐ ๋ทฐ ์ปจํธ๋กค๋ฌ๋ฅผ ๋ง๋๋ ๋ฐ ๋ช ๊ฐ์ง ๋ฌธ์ ๊ฐ ์์ต๋๋ค. ๋๊ตฐ๊ฐ ์๋ก ์๋ฅธ ์ด๋ฏธ์ง๋ฅผ ํฌํจํ๋ ํจ์์ ํจ๊ป ์ฝ๋๋ฅผ ๋ณด์ฌ์ค ์ ์์ต๋๊น? ์ ๋ง ๊ณ ๋ง์!
์๋ฅผ ๋ค์ด @ srosman8026
extension YourVC : TOCropViewControllerDelegate {
func openCrop(image: UIImage) {
let crop = TOCropViewController(croppingStyle: .circular, 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.updatePhoto(image: image)
})
}
func cropViewController(_ cropViewController: TOCropViewController, didFinishCancelled cancelled: Bool) {
cropViewController.dismiss(animated: true, completion: {
})
}
}
๋ค! @drougojrom ์ด ๋ง์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค! :)
Swift ์์ ํ๋ก์ ํธ๋ ๋ง๋๋ ๊ฒ์ด ๊ฐ์ฅ ์ข์ต๋๋ค.
@TimOliver , ๋ฐ๋ชจ ์ฉ์ผ๋ก ์์ ํ๋ก์ ํธ ์ธ ๋ณ๋์ ์ ์ํ ํ๋ก์ ํธ๊ฐ ์์ต๋๋ค. ๋ณ๋์ ์ ์ฅ์์ ์ ๋ก๋ํ๊ฑฐ๋ ํ๋ก์ ํธ ๋ด๋ถ์ ์ถ๊ฐ ํ ์ ์์ต๋๋ค.
์๋ก์ด ๋ฌธ์ ๋ฅผ ์ด โโ์ ์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์๋ฅผ ๋ค์ด @ srosman8026