Writing handler for UIAlertAction

后端 未结 9 898
北恋
北恋 2020-11-28 05:10

I\'m presenting a UIAlertView to the user and I can\'t figure out how to write the handler. This is my attempt:

let alert = UIAlertController(ti         


        
9条回答
  •  清酒与你
    2020-11-28 05:27

    Syntax change in swift 3.0

    alert.addAction(UIAlertAction(title: "Okay",
                    style: .default,
                    handler: { _ in print("Foo") } ))
    

提交回复
热议问题