你能帮我解决这个问题
WS.pay_bay_cb("some params") {
(response) in
let abc = response["response"] as? NSDictionary
print(abc!["ref_code"] as? String) // i get this 12345 code that i want to display
code_container.hidden = fasle
self.validation_code.text = abc!["ref_code"] as? String
}
我想在 UIView 内的 UITextField 中显示 ref_code。
View 仍然隐藏的问题,任何人都可以向我解释如何解决这个问题,谢谢。
最佳答案
尝试这样
WS.pay_bay_cb("some params") {
(response) in
let abc = response["response"] as? NSDictionary
print(abc!["ref_code"] as? String) // i get this 12345 code that i want to display
dispatch_async(dispatch_get_main_queue(), {
self.code_container.hidden = fasle
self.validation_code.text = abc!["ref_code"] as? String
})
}
关于ios - API 成功 200 后无法在 UIView 内的 UITextField 中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41504357/