2016-07-07 23 views
0

我使用「UIAlertController」 &「presentViewController」,顯示alertview,像下面如何在swift中更新當前的alertview標題?

 let deviceName = bleManager.activePeripheral?.name 
     let alert = UIAlertController(title: "Connecting...", message: deviceName, preferredStyle: UIAlertControllerStyle.Alert) 
     presentViewController(alert, animated: true, completion: nil) 

現在我想從「連接」到「搜索」更新當前的標題,但alertview不能解僱。

如何做到這一點?

回答

2

您可以將警報對象存儲在一個屬性,並訪問它,只要你需要更新它。

這包括更改標題或添加操作。

相關問題