Can a UIGestureRecognizer in a storyboard use multiple views?

I created many views and buttons, then created the ISwipeGestureRecognizer GUI. And he added a lot of opinions for the Outlet assembly reference recognizers. And gesture wipes work on all my looks. How is this possible? Does the storyboard automatically create different SwipeRecognizers for each connected UIView?

84b697c8df865c2a5f00fdf2928e3212.png

I can not add more views programmatically, why?

+3
source share
3 answers

, , , , : NSLog ( , ). , , .

, recognizer.view, , . , , UISwipeRecognizer view - , .

, , view. , " ", , .

+2

Interface Builder. . , , . , , .

, . , .

, , , .

+2

You can add one gesture recognizer for as many views as you like, either in code or using the interface builder. You use the method for this addGestureRecognizer: UIView. Note that you are adding a recognizer to the view, not the other way around.

0
source

All Articles