get the value of variable out of closure swift
问题 So I have a closure called task which is a post request and I have a global variable called values and I'm trying to set the value of "values" to be the data that I retrieved back from database stored in a variable called "array". Don't worry about the tableview.reloadData part, that's already done. i just wanna know how to get the value out of closure. var values:NSArray = [] @IBOutlet weak var Open: UIBarButtonItem! override func viewDidLoad() { super.viewDidLoad() Open.target = self