Swiftpack.co - Package - malt03/UpdateInfoPresenter

UpdateInfoPresenter SwiftPM compatible CocoaPods License

UpdateInfoPresenter is a library that allows you to properly present the specified UIViewController to users who have updated the version of your app.

Usage

Present

If you implement the following code, the specified viewController will be displayed when the app is launched, if necessary.
If you pass nil to the viewController argument, UpdateInfoPresenter will not present anything, but it will check and save the version.
The saved version will be used the next time you pass a value other than nil to the viewController.

func sceneDidBecomeActive(_ scene: UIScene) {
    UpdateInfoPresenter.presentIfNeeded(
        viewController: UIStoryboard(name: "Main", bundle: .main).instantiateViewController(withIdentifier: "UpdateInfo"),
        targetVersion: 1,
        presentingOption: [.newUser, .skippedUser]
    )
}

Dismiss

UpdateInfoPresenter creates a special window and displays a viewController on it.
To dismiss it, call the following method.

UpdateInfoPresenter.dismiss()

Conditional Branching with presentingOption

target version = 3

.empty

|previous|current|present| |:--|:--|:--| |nil|2|| |nil|3|| |nil|4|| |1|2|| |1|3|✔| |1|4|| |3|3|| |3|4||

.newUser

|previous|current|present| |:--|:--|:--| |nil|2|| |nil|3|✔| |nil|4|| |1|2|| |1|3|✔| |1|4|| |3|3|| |3|4||

.skippedUser

|previous|current|present| |:--|:--|:--| |nil|2|| |nil|3|| |nil|4|| |1|2|| |1|3|✔| |1|4|✔| |3|3|| |3|4||

[.newUser, .skippedUser]

|previous|current|present| |:--|:--|:--| |nil|2|| |nil|3|✔| |nil|4|✔| |1|2|| |1|3|✔| |1|4|✔| |3|3|| |3|4||

Github

link
Stars: 0

Dependencies

Used By

Total: 0

Releases

v0.1.0 - 2020-10-13 06:24:20

  • Change API.

v0.0.2 - 2020-10-12 16:44:07

  • Fixed a bug when not using UIScene on iOS13 or later.

v0.0.1 - 2020-10-12 15:26:37

First Release