Swift Request App Rating / Review
Since iOS 10.3 Apple has provided a way to request for an app review / rating inside your app. As of iOS 11 you will be required to implement it this way vs using third party methods. So lets look at how we can code it.
Simply add the following block of code to request an app review:
if #available(iOS 10.3, *) { SKStoreReviewController.requestReview() } else { // Request review from a manual method here }
This block of code checks if iOS is at version 10.3 or later, as this method is only available from iOS 10.3 onwards. If not you can add in your manual method to request for a rating in the else block.
A quick note on this block of code – it won’t always show a prompt for an app rating, only when appropriate. So it will show most of the time but if iOS is busy with something else in your app it may not show up. See here for more details.