Launching App Store from App in Swift

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

    I use this and it works.

    let locale: String = Locale.current.regionCode ?? "US"
    UIApplication.shared.open(URL(string: "https://apps.apple.com/\(locale)/developer/{developer-name}/{idXXXXXXXXXX}")!, options: [:], completionHandler: nil)
    

提交回复
热议问题