Swiftpack.co - Hengyu/Migration as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Hengyu.
Hengyu/Migration 2.0.0
Manages blocks of code that only need to run once on version updates in iOS apps.
⭐️ 2
🕓 2 years ago
iOS macOS tvOS
.package(url: "https://github.com/Hengyu/Migration.git", from: "2.0.0")

Migration

Manages blocks of code that need to run once on version updates in iOS apps. This could be anything from data normalization routines, "What's New In This Version" screens, or bug fixes.

This is the Swift version of MTMigration.

Table of contents

Requirements

  • Swift 5.9
  • iOS 12.0+, tvOS 12.0+, macOS 11.0+, visionOS 1.0+

Installation

Migration could be installed via Swift Package Manager. Open Xcode and go to File -> Add Packages..., search https://github.com/hengyu/Migration.git, and add the package as one of your project's dependency.

Usage

Migration.applicationUpdate {
    // do your migration code here
    self.cache.clear()
    self.preferenceStore.reset()
}

Notes

Migration assumes version numbers are incremented in a logical way, i.e. 1.0.1 -> 1.0.2, 1.1 -> 1.2, etc.

License

Migration is released under the MIT License.

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