Launching App Store from App in Swift

前端 未结 9 995
情深已故
情深已故 2020-12-31 01:43

I am creating an app, and I have a banner which promotes my other app. This is my code:

var barsButton : UIButton = UIButton(frame: CGRectMake((self.view.bou         


        
9条回答
  •  無奈伤痛
    2020-12-31 02:40

    Just by following older answers I couldn't make it work, so here I post my complete solution:

    if let url  = NSURL(string: "itms-apps://itunes.apple.com/app/id1234567890"), 
       UIApplication.shared.canOpenURL(url) {
        
      UIApplication.shared.openURL(url)
        }
    }
    

提交回复
热议问题