Guest User

Untitled

a guest
Apr 21st, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. override func viewDidLoad() {
  2. super.viewDidLoad()
  3.  
  4. NotificationCenter.default.addObserver(self, selector: #selector(GameViewController.doaSegue), name: NSNotification.Name(rawValue: "doaSegue"), object: nil)
  5.  
  6. //I kept out all of the code for setting up the scene
  7. }
  8.  
  9.  
  10. @objc func doaSegue(){
  11.  
  12. performSegue(withIdentifier: "show", sender: self) //The error occurs on this line
  13. self.view.removeFromSuperview()
  14. self.view = nil
  15.  
  16. }
  17.  
  18. let Action1 = SKAction.fadeAlpha(to: 0.75, duration: 5)
  19.  
  20. let Action2 = SKAction.run {
  21.  
  22. print("segue")
  23. NotificationCenter.default.post(name: NSNotification.Name(rawValue: "doaSegue"), object: nil)
  24.  
  25. }
  26.  
  27. shape.run(SKAction.sequence([Action1, Action2]))
  28.  
  29. // let Action2 = SKAction.run {
  30.  
  31. print("segue")
  32. NotificationCenter.default.post(name: NSNotification.Name(rawValue: "doaSegue"), object: nil)
  33.  
  34. // }
  35.  
  36. // shape.run(SKAction.sequence([Action1, Action2]))
Add Comment
Please, Sign In to add comment