简体   繁体   中英

Control-drag UIView in Storyboard to present a controller?

I know it's possible to control-drag a table view cell in order to present a controller from the storyboard, but I can't seem to be able to do the same for a UIView . What reason is there for this? Why can't I control-drag a UIView in the storyboard to present a controller?

Using the Xcode interface builder through storyboard you need to add a gesture to the UIView.

  1. Drag a tap gesture and place it on top of the related UIView. (The gesture will appear at the bottom of elements in the controllers structure on the left.)
  2. Now you can Ctrl+Drag from that gesture to present your controller as you mentioned.

Hope that solves your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM