A Swift library to show a SKStoreReviewController (iOS 10.3 or above) or custom UIAlertController with similar rules and behaviours.
This library has been deprecated and is no longer actively maintained. Its simply time to move on from supporting iOS 10 in your apps.
CocoaPods is a dependency manager for Cocoa projects. Simply install the pod by adding the following line to your pod file
pod 'SwiftyRate'
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler.
To add a swift package to your project simple open your project in xCode and click File > Swift Packages > Add Package Dependency.
Than enter https://github.com/crashoverride777/swifty-rate.git
as the repository URL and finish the setup wizard.
Alternatively if you have a Framwork that requires adding SwiftyRate as a dependency is as easy as adding it to the dependencies value of your Package.swift.
dependencies: [
.package(url: "https://github.com/crashoverride777/swifty-rate.git", from: "3.5.0")
]
Alternatively you can copy the Sources
folder and its containing files into your project.
import SwiftyRate
As Apple describes in the documentation for SKStoreReviewController
"Although you should call this method when it makes sense in the user experience flow of your app, the actual display of a rating/review request view is governed by App Store policy. Because this method may or may not present an alert, it's not appropriate to call it in response to a button tap or other user action."
UIViewController
let ratingsRequest = SwiftyRate.Request(
afterAppLaunches: 15,
customAlertTitle: "Enjoying this app"?,
customAlertMessage: "Tap the stars to rate it on the App Store.",
customAlertActionCancel: "Not Now"
)
SwiftyRate.requestReview(ratingsRequest, from: self)
SKScene (needs to be called outside/after DidMoveToView or it will not work)
if let viewController = view?.window?.rootViewController {
let ratingsRequest = SwiftyRate.Request(...)
SwiftyRate.requestReview(ratingsRequest, from: viewController)
}
SwiftyRate is released under the MIT license. See LICENSE for details.
link |
Stars: 24 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics