Failing Alert
Closed this issue · 2 comments
J-Arji commented
hello
when i in insert alert to my project but not running.
can you help me ??
NSURLSession.sharedSession().dataTaskWithURL(url){ [unowned self] (data , repsonse , error) in
if error != nil {
print(error!)
let alertView = UNAlertView(title: "hello", message: "link failing ")
alertView.addButton("Done", action: {
self.navigationController?.popViewControllerAnimated(true)
})
// Show
alertView.show()
} else {
ytakzk commented
@J-Phantom I know the reason why you cannot run the code. Let me update some codes in a few days.
ytakzk commented
@J-Arji You have to wrap it to run in the main thread. Can you try that?
dispatch_sync(dispatch_get_main_queue(), {
let alertView = UNAlertView(title: "hello", message: "link failing ")
alertView.addButton("Done", action: {
self.navigationController?.popViewControllerAnimated(true)
})
// Show
alertView.show()
});