Post

Replies

Boosts

Views

Activity

Reply to Closure?
Wow thanks for the answer, I had been searching for hours! I am still hitting an error though, I have a few buttons on the view that start disabled, then when the user successfully logs in, the buttons enable.When I putself.button.isEnabled = truein the success case, I get a message-[UIButton setEnabled:] must be used from main thread onlyso I tried to do this: submitPost(post: myPost) { (result) in switch result { case .success(let value): print(value) loginSuccessful = value //...use value here case .failure(let error): print(error) fatalError(error.localizedDescription) } }if (loginSuccessful == "Success"{ //enable Buttons}but while the print(value) does print "Success", I then try to set loginSuccessful to value, but loginSuccessful is "" outside the case and so the buttons never enable..Thanks for the help!
Dec ’19