Closed MVJadav closed 6 years ago
Hi @MVJadav! You might need to upload a screen recording to show us what's happening exactly! :)
Hello Sir. Please check attachment video. movement vety fast.zip
func ImageCrop(image:UIImage) {
//initializing the TOCropViewController
let controller:TOCropViewController = TOCropViewController(croppingStyle: .default, image: image)
controller.delegate = self
controller.aspectRatioPreset = .presetSquare
controller.cropView.aspectRatioLockEnabled = true
controller.cropView.cropBoxResizeEnabled = false
controller.aspectRatioPickerButtonHidden = true
present(controller, animated: true, completion: nil)
}
func cropViewController(_ cropViewController: TOCropViewController, didCropToImage image: UIImage, rect cropRect: CGRect, angle: Int) {
self.updateImageViewWithImage(image: image, cropViewController: cropViewController)
}
func updateImageViewWithImage(image:UIImage, cropViewController:TOCropViewController) {
cropViewController.presentingViewController?.dismiss(animated: true, completion: nil)
self.IBimgLogo.image = image
}
Ahh thanks for that! I see the problem.
You're setting the properties on cropView
directly. That's not recommended since the view controller itself also needs to perform some management logic on top. There should be an equivalent method in the TOCropViewController
header for the operations you want to do.
If you change it to:
let controller:TOCropViewController = TOCropViewController(croppingStyle: .default, image: image)
controller.delegate = self
controller.aspectRatioPreset = .presetSquare
controller.aspectRatioLockEnabled = true
controller.aspectRatioPickerButtonHidden = true
controller.resetAspectRatioEnabled = false
That SHOULD fix it. Avoid changing the properties in cropView
directly. If there's something particular you want to do that can't be done from the TOCropViewController
level, let me know. :)
Good luck!
Hello sir, i used that changes, but still same issue occurring.....
func ImageCrop(image:UIImage) {
let controller:TOCropViewController = TOCropViewController(croppingStyle: .default, image: image)
controller.delegate = self
controller.aspectRatioPreset = .presetSquare
controller.aspectRatioLockEnabled = true
controller.aspectRatioPickerButtonHidden = true
controller.resetAspectRatioEnabled = false
present(controller, animated: true, completion: nil)
}
Hmm. It's working fine for me in the demo app. Are you using the latest version of the library?
yes sir. we are using latest version of the library pod.....
please see that screens, when i going to crop my image i face that issue, movement is very fast. i'm using tab bar in my App.
I've got nothing. If I can't replicate it on my own devices, I can't fix it. Sorry.
Make sure you've properly got the latest version by running 'pod repo update'. If it keeps happening, see if you can replicate it in a demo app for me. :)
i got issue. when i use https://github.com/vlasov/CCBottomRefreshControl in my app then i face that issue. just copy past 'CCBottomRefreshControl' class and run the app, you can face that issue. https://github.com/vlasov/CCBottomRefreshControl/tree/master/Example/BottomRefreshControlExample i used below classes in my app. IBScrollViewController.h IBScrollViewController.m UIScrollView+BottomRefreshControl.h UIScrollView+BottomRefreshControl.m UIView+TKGeometry.h UIView+TKGeometry.m
Can you resolved that issue..?
is it possible custom rotate image with 'TOCropViewController' pod....?
Hmm, if there's a category in another project that modifies the behaviour of UIScrollView
, that could certainly do it. I don't know if that's something I can explicitly support though. Sorry.
In any case, I had to substantially modify some of the workings of this library for iPhone X support, so it might be worth testing again.
Good luck!
Hi @vientn1998! I can't offer free tech support, so I can't promise if I can actually help or not. 😅 Please open a new issue and provide as much info about your app and any other third party libraries you might be using. 🙏
Hello, i used TOCropViewController to crop image,but when i cropping image, zoomin-zoomout (Movement) is very fast. image moved very fast. that issue occured in app.