Swift - How to present ViewController when tapping button in a custom AlertController

后端 未结 4 423
失恋的感觉
失恋的感觉 2021-01-28 03:31

I am developing in Swift 2.3

I have an Utils class enabling me to create UIAlertController easily.

public class Utils {

    cl         


        
4条回答
  •  清歌不尽
    2021-01-28 03:42

    What about

    let alert = Utils.buildAlertInfo(
      withTitle: "Information",
      andMessage: "John Snow is dying",
      withHandler: { action in self.go(to: specificViewController) }
    )
    self.presentViewController(alert, animated: false, completion: nil)
    

    ?

提交回复
热议问题