Closed JulesMoorhouse closed 1 year ago
@JulesMoorhouse you can easily do it in SwiftUI with something like this
@main
struct SwiftRateDemoApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
SwiftRater.daysUntilPrompt = 7
SwiftRater.usesUntilPrompt = 10
SwiftRater.significantUsesUntilPrompt = 3
SwiftRater.daysBeforeReminding = 1
SwiftRater.showLaterButton = true
SwiftRater.debugMode = true
SwiftRater.appLaunched()
return true
}
}
More info about UIApplicationDelegateAdaptor
here
Thanks markgravity for the follow up. I've added this in README. https://github.com/takecian/SwiftRater/commit/3cf8ff522902f4d8f0aa5cfecdd842e517d5ed91
Hey,
I've used SwiftRater in other older apps in the past, Objective C apps, I've found it works really well.
I'd really like to use this with SwiftUI now.
Jules.