我正在使用 UICollectionView 和标题中的地图。
我想处理核心位置错误。我有 3 种错误类型,对于其中两种,我想提供一个UIAlertView
.
但我收到错误,因为UICollectionViewCell
没有名为的成员presentViewController
.
func locationUnknown() {
var alert = UIAlertController(title: "Location Unknown", message: "Please try again later.", preferredStyle: UIAlertControllerStyle.Alert)
let alertAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (action: UIAlertAction!) -> Void in
})
alert.addAction(alertAction)
self.presentViewController(alert, animated:true, completion: nil)
}
我怎样才能发送这个UIAlertView
to the UICollectionView
的屏幕?
使用窗口的根视图控制器来显示警报:
self.window?.rootViewController?.present(alert, animated: true, completion: nil)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)