从 TableViewCell 弹出到另一个 ViewController 的正确方法
Proper way to pop to another ViewController from a TableViewCell
我有一个 TableView
,带有动态加载的自定义单元格,我已将 GestureRecognizer
附加到 ImageView
,这样当您按住 ImageView
和ActionSheet
出现时带有允许用户发送私人消息的选项。我已经创建了用于发送消息的 ViewController
,我只需要知道如何弹出它,因为 class UITableViewCell
不包括 storyboard
或 navigation controller
.有人建议我从 TableViewController
中调用一种方法,但我没有实现。有人请指教。谢谢。
必须由 UIApplication.sharedApplication().keyWindow?.rootViewController?.presentViewController(actionSheet, animated: true, completion: nil)
从根 View Controller
调用
我有一个 TableView
,带有动态加载的自定义单元格,我已将 GestureRecognizer
附加到 ImageView
,这样当您按住 ImageView
和ActionSheet
出现时带有允许用户发送私人消息的选项。我已经创建了用于发送消息的 ViewController
,我只需要知道如何弹出它,因为 class UITableViewCell
不包括 storyboard
或 navigation controller
.有人建议我从 TableViewController
中调用一种方法,但我没有实现。有人请指教。谢谢。
必须由 UIApplication.sharedApplication().keyWindow?.rootViewController?.presentViewController(actionSheet, animated: true, completion: nil)
View Controller
调用