我想说明UIAlertController
的UITableViewCell
类。
在搜索时,我发现这样UIApplication.shared.keyWindow?.rootViewController?.present
做会显示出来。
其作品的情况下,如果打开的ViewController
是下NavigationController
,因为我rootViewController
是一个NavigationController
和其下的视图cell
被呈现。
那么我该如何呈现UIAlertController
在UITableViewCell
其中。
您需要实现delegate
模式。
创建一个protocol
由您的控制器实现的控件,并将weak
该控制器的引用分配给您的单元格。
然后使用类似 cell.delegate.didPerformAction()
该单元格是一个View
,它不应该负责呈现任何内容。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句