TimOliver / TOCropViewController

A view controller for iOS that allows users to crop portions of UIImage objects
http://www.timoliver.com.au/2015/06/21/tocropviewcontroller-an-open-source-image-cropper-for-ios/
MIT License
4.7k stars 938 forks source link

to change only image of ToCropView #115

Closed NiteshKhandal closed 8 years ago

NiteshKhandal commented 8 years ago

i create ToCropView like:

    self.cropView = TOCropView()
    self.cropView = TOCropView(image: Image)
    self.cropView.frame = CGRectMake(35, cropView_Y, cropView_Width, cropView_Height)
    self.cropView.backgroundColor = UIColor.clearColor()
    self.view.addSubview(self.cropView)

but i want to change the image of cropView on the tap CollectionView Cell then how do i change image of ToCropView and also i tap again and again.

my screen look like as below link:

simulator screen shot 30-jun-2016 3 46 29 pm

here i have to change image of my cropView when user tap on image shown below in the screen.

TimOliver commented 8 years ago

Oh dear! Okay, I see what you're trying to do now.

I never designed TOCropView to allow its image to be switched (I didn't really even intend for it to be used outside of the TOCropViewController class!) so as far as I know, it can't handle that.

Probably the quickest and easiest thing to do is to create a new TOCropView from scratch whenever the user taps a new image in the collection view. Since this is a user initiated action, this isn't a bad compromise and there shouldn't be any visible performance hits.

Beyond that, it would be necessary to add the image-swapping functionality to TOCropView itself.

TimOliver commented 8 years ago

I'm going to close this issue now. Feel free to re-open it if you need additional help. :)

NiteshKhandal commented 8 years ago

ok , no problem i have solved my issue... :)

techoutliers commented 3 years ago

@NiteshKhandal Is it possible to share how you solved your problem?