Launching App Store from App in Swift

前端 未结 9 1019
情深已故
情深已故 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:39

    Use just the short "itms://".

    For Swift 3 this is the snippet:

    UIApplication.shared.openURL(URL(string: "itms://itunes.apple.com/app/id" + appStoreAppID)!)
    

    I hope this helps someone.

    Cheers.

    P.S. @Eric Aya was ahead of the time :)

提交回复
热议问题