配列「listINeed」をハンドラ関数「handleConfirmPressed」に渡す方法はありますか? クラス変数として追加することでこれを行うことができましたが、それは非常にハックに思えたので、複数の変数に対してこれを行いたいので、より良い解決策が必要です。
func someFunc(){
//some stuff...
let listINeed = [someObject]
let alert = UIAlertController(title: "Are you sure?", message: alertMessage, preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Cancel", style: .Cancel, handler: nil))
alert.addAction(UIAlertAction(title: "Confirm", style: .Destructive, handler: handleConfirmPressed))
presentViewController(alert, animated: true, completion: nil)
}
func handleConfirmPressed(action: UIAlertAction){
//need listINeed here
}