مرحبًا ، أنا حاليًا في برنامج swift 3 وأواجه بعض المشكلات في إنشاء وحدة تحكم عرض دائرية للمحصول من خلال طريقة التفويض. هل يمكن لأي شخص أن يوضح لي الكود الخاص به للقيام بذلك جنبًا إلى جنب مع الوظائف المسماة التي تحتوي على الصورة التي تم اقتصاصها حديثًا. شكرا جزيلا!
@ 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 ، على سبيل المثال