Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

richardcanada

macrumors newbie
Original poster
Jun 20, 2016
1
0
Hello everyone,



Does anyone know what went wrong when I code the following button to link to the App Store?



@IBAction func appStore(sender: AnyObject) {

if let url = NSURL(string: "https://geo.itunes.apple.com/us/app/clash-royale/id1053012308?mt=8")

{ UIApplication.sharedApplication().openURL(url)

}


}



That is an affiliate link from iTunes Link Maker. I connected it to a button on my app. Why the affiliate link can't open with this code? This block of code can open other general web links in the app. What should I change?



Thank you,



Richard
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.