How to present an AlertView from a UICollectionViewCell

前端 未结 1 1125
野性不改
野性不改 2021-01-14 08:33

I am using a UICollectionView with a Map in the header.

I want to handle Core Location errors. I have 3 error types and for two of them I want to present a UIA

1条回答
  •  花落未央
    2021-01-14 09:20

    Use the window's root view controller to present the alert:

    self.window?.rootViewController?.present(alert, animated: true, completion: nil)
    

    0 讨论(0)
提交回复
热议问题