Marty
Marty

Reputation: 6174

How can you check if a view is currently being shown in iPhone?

I've got a scroll view that shows different uiimageviews, and only one is shown at a time (it snaps so there's always only one showing). How can I check which one is being shown? something like...

if(imgView.bounds == self.view.bounds)

?

Upvotes: 1

Views: 925

Answers (1)

Jilouc
Jilouc

Reputation: 12714

Maybe

if (CGRectIntersectsRect(imgView.frame, scrollView.bounds))

(assuming scrollView is your UIScrollView)

Upvotes: 2

Related Questions