This is a fairly simple proposal.
I believe that the Version struct from the PackageDescription library should be moved into the swift standard library, and Codable conformance should be added.
Apps often need a way of checking if they are out of date. Usually this is used to let users know that there is a new version of the app available.
Nobody is perfect, and sometimes breaking bugs slip into production code. When this happens, it's important to get users off of the broken version as quickly as possible.
Generally, this is achieved by:
fetching the current production version from: https://itunes.apple.com/lookup?bundleId=appBundleId
comparing the on-device version with the current production version from the App Store and letting users know an update is available if the production version > on-device version.
To make this process cleaner, its also common to make a custom Version class with the following characteristics:
has a Major, Minor, Patch property (Int)
can be initialized from a string, or series of Ints
Conforms to Equatable, Comparable, Codable to allow comparisons and decoding the version number from AppStore response.
Unsurprisingly, this functionality already exists and is already heavily in use with the swift package manager.
However, if you try to import PackageDescription into your app targets to use the Version struct, you are greeted with "Module 'PackageDescription' not found"
The only thing the current implementation is missing is Decodable conformance.
I think that having this Version struct available in the Swift standard library, with Codable conformance would be a very nice quality-of-life addition to the language.