swift3
1if leftTime > 0{ 2 let alert = UIAlertController(title: "もう少し時間をあけてください", message: "あと\(leftTime/60)分待ってください", preferredStyle: .alert) 3 let okAction = UIAlertAction(title: "OK", style: .default, handler: nil) 4 alert.addAction(okAction) 5 present(alert, animated: true, completion: nil) 6 7 let targetViewController = self.storyboard!.instantiateViewController( withIdentifier: "watch" ) 8 self.present( targetViewController, animated: true, completion: nil) 9 } 10 if leftTime <= 0{ 11 //messageLabel.text = metadataObj.stringValue 12 startTime = Date().timeIntervalSinceReferenceDate 13 timer = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(updateLabel), userInfo: nil, repeats: true) 14 }
どちらも単体では動いたのですが、まとめるとアラートだけが実行されて画面遷移が行われません。なぜなのか教えてください。またどうすればいいのかもおながいします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2017/08/09 13:55
2017/08/09 22:45
退会済みユーザー
2017/08/10 05:34