привет!
шлю пользователю алерт и потом делаю гет запрос исходя с ответом пользователя
var a = 0 // default
let userAction = UIAlertController(title: "Select", message: "Select an action", preferredStyle: UIAlertControllerStyle.alert)
userAction.addAction(UIAlertAction(title: "action 1", style: .default, handler: { (action: UIAlertAction!) in
a = 1
}))
userAction.addAction(UIAlertAction(title: "action 2", style: .cancel, handler: { (action: UIAlertAction!) in
a = 2
}))
present(userAction, animated: true, completion: nil)
let resp = Just.get("http://localhost/\(a)").text
return resp
но запрос посылается до того как пользователь выберет опцию
как сделать так что бы код после алерта не бежал пока алерт не будет закрыт?