Displaying a UIAlertController in GameScene (SpriteKit/Swift)

后端 未结 3 910
青春惊慌失措
青春惊慌失措 2021-01-15 00:39

The simple way to display a UIAlertView, in swift is:

let alert = UIAlertView()
alert.title = \"Alert!\"
alert.message = \"A wise message\"
alert.addButtonWi         


        
3条回答
  •  攒了一身酷
    2021-01-15 01:26

    Try using this. I work in SpriteKit and I used this code for my in app purchase messages in my game, Chomp'd.

    self.view?.window?.rootViewController?.presentViewController(myAlert, animated: true, completion: nil)
    

提交回复
热议问题