Swiftpack.co - crashoverride777/swifty-rate as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by crashoverride777.
crashoverride777/swifty-rate v3.2.4
A Swift library to show a SKStoreReviewController or a custom app rating alert. This library is no longer actively maintained.
⭐️ 24
🕓 1 year ago
iOS
.package(url: "https://github.com/crashoverride777/swifty-rate.git", from: "v3.2.4")

Swift 5.0 Platform SPM supported CocoaPods Compatible

SwiftyRate

A Swift library to show a SKStoreReviewController (iOS 10.3 or above) or custom UIAlertController with similar rules and behaviours.

Deprecated

This library has been deprecated and is no longer actively maintained. Its simply time to move on from supporting iOS 10 in your apps.

Requirements

  • iOS 9.3+
  • Swift 5.0+

Installation

Cocoa Pods

CocoaPods is a dependency manager for Cocoa projects. Simply install the pod by adding the following line to your pod file

pod 'SwiftyRate'

Swift Package Manager

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")
]

Manually

Alternatively you can copy the Sources folder and its containing files into your project.

Usage

  • Add the import statement when using CocoaPods or SwiftPackageManager
import SwiftyRate 
  • Request review

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)
}

License

SwiftyRate is released under the MIT license. See LICENSE for details.

GitHub

link
Stars: 24
Last commit: 1 year ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Deprecated
1 year ago
  • Deprecated this library

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics