我希望切换用户到另一个页面
我使用此代码:
let storyBoard = UIStoryboard(name: "Main", bundle: nil)
let vcAboutUs = storyBoard.instantiateViewController(withIdentifier: "ViewControllerIndex")
self.present(vcAboutUs, animated: true, completion: nil)
但是在运行项目后,我收到Thread 1: signal SIGABRT
错误并且模拟器崩溃了
图片:https://i.stack.imgur.com/d1uIT.jpg
完整代码:
DispatchQueue.global(qos: .background).async {
let getJsonLogin = GetData()
let result = getJsonLogin.getJson(urlGet: AppDelegate.ADDRESS+"/index.php", urlData: "mobile="+mobile+"&code="+getCode+"") { result in
DispatchQueue.main.async {
if(result == nil){
self.progressText.text = "Error";
} else {
if((result!["error"]!) == "true"){
self.progressTextCode.text = result!["message"]!;
} else {
let storyBoard = UIStoryboard(name: "Main", bundle: nil)
let vcAboutUs = storyBoard.instantiateViewController(withIdentifier: "ViewControllerIndex")
self.present(vcAboutUs, animated: true, completion: nil)
}
}
}
}