Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. internal func rate(appId: String, completion: @escaping ((_ success: Bool) -> ())) {
  2. guard let url = URL(string: "itms-apps://itunes.apple.com") else {
  3. completion(false)
  4. return
  5. }
  6. guard #available(iOS 10, *) else {
  7. completion(UIApplication.shared.openURL(url))
  8. return
  9. }
  10. UIApplication.shared.open(url, options: [:], completionHandler: completion)
  11. }
  12.  
  13. internal func rateUsButtonTouched() {
  14. isUserInteractionEnabled = false
  15. menuSceneNodeDelegate?.rate(appId: "appID", completion: {_ in
  16. self.isUserInteractionEnabled = true
  17. })
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement