2017-03-16 1 views
-3

私はボタンをクリックしてスピンホイールを作ろうとしています。ボタンのクリックで円形の画像を回転させ、1回転後に停止します。今度は彼が得たポイントを示すポップアップを表示したい。私はラベルを使ってそれをするつもりです。しかし、私はポップアップを表示する方法について混乱しています。Xcode、Swift3でUIImageを円で回転させた後にポップアップビューを表示するにはどうすればいいですか?

+0

使用alertViewcontroller https://developer.apple.com/reference/uikit/uialertcontroller迅速です –

答えて

0

あなたは、次のUIAlertViewController

を使用することができますが3コード

var alert = UIAlertController() 

override func viewDidLoad() { 
    super.viewDidLoad() 
    self.alert = UIAlertController(title: "Congratulations!", message: "You have won 100 points", preferredStyle: .alert) 
    self.alert.addAction(UIAlertAction(title: "Done", style: .default, handler: {action in 
     switch action.style { 
     case .default: 
      //do your other stuff ahead after receiving points 
     case .cancel: 
      print("cancel") 
     case .destructive: 
      print("destruct") 
     }})) 
} 

//your rotation stopped 
//call the UIAlertViewController 
self.present(self.alert, animated: true, completion: nil) 
関連する問題