swift跳转到Appstore

时间:2023-03-08 16:52:31
swift跳转到Appstore

//进入appstore中指定的应用

let str = NSString(format: "itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa /wa/viewContentsUserReviews?type=Purple+Software&id=%d", "myAppID")

UIApplication.shared.canOpenURL(NSURL(string: str as String) as! URL)

//进入首页

let str = NSString(format: "itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=%@", "myAppID")

UIApplication.shared.canOpenURL(NSURL(string: str as String) as! URL)