【问题标题】:How do I dismiss the alert in Swift after it's presented?出现后如何在 Swift 中解除警报?
【发布时间】:2022-11-14 12:47:39
【问题描述】:

我有一个简单的警报,我希望用户能够关闭它。只是在 Swift 5 / iOS 13 中寻找最简单的方法

present(alert, animated: true, completion: nil)

【问题讨论】:

标签: swift


【解决方案1】:

当您想隐藏时添加此代码

self.dismiss(animated: true)

【讨论】:

  • 这个问题清楚地表明是 iOS 13,而不是 iOS 15。
猜你喜欢
  • 2021-08-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-03-28
  • 2020-02-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多