How to Open App Store with Swift

How to Open App Store with  Swift

To open the App Store with Swift, you can use the UIApplication.shared.open method and pass in the URL of the App Store as the argument. Here is an example:

if let appStoreURL = URL(string: "https://itunes.apple.com/us/app/apple-store/id375380948") {
 UIApplication.shared.open(appStoreURL)
}

This code attempts to create a URL an object from the App Store's URL string and, if successful, opens the App Store. You may need to adjust the URL string to match the correct App Store for your region.