Reputation: 1656
Newbie questions.
I have UICollectionView with cells created in storyboard. I customized cell by adding to it UIImage. By tapping at image I want to show image preview (same image of bigger size). I tried to use -didSelectItemAtIndexPath:
method, but I can't understand how I can handle what cell I tapped to point to the UIImage in this particular cell, because I haven't cell like argument for this native method.
And additional question: Does xcode have a native method for making photo preview (when image come closer and background slightly fading), or I need to implement it by myself?
Upvotes: 0
Views: 290
Reputation: 9241
If you have a look at didSelectItemAtIndexPath
you'll see that it gives you an index path to work with. You can use that index path to get your cell using UICollectionView cellForItemAtIndexPath
instance method. You cast it to your own custom cell and there you are.
As for the second question, I'm afraid you have to implement yourself, there is no component to do that, not from Apple anyway (except if you want to use modals).
Upvotes: 1