0
클릭 할 때 두 가지 작업을 수행해야합니다. 메시지 표시 및 다른 사용자 인터페이스로 이동. 당신은 또한 동일한보기를 제공하려는 경우 그러나 여기에만 작업 1 실행하지만 2왜 작업 2를하고 있지 않습니까?
@IBAction func sendMessage(_ sender: AnyObject) {
// TASK 1 - OK
let alert = UIAlertController(title: "Task 1", message: "Test message.", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true)
// TASK 2 - FAIL (does not execute)
let x = XyzViewController()
x.body = "test";
self.present(x, animated: false, completion: nil)
}
콘솔을보십시오. 문제를 알려주는 오류 메시지가 있어야합니다. – rmaddy
그리고 작업 2 코드가 실행 중입니다. 디버거를 사용하여 확인하십시오. – rmaddy