ReleaseNotesKit - a brand new, elegant, and extremely simple way to present the recent version’s release notes to your users

Overview

ReleaseNotesKit

This is ReleaseNotesKit, a brand new, elegant, and extremely simple way to present the recent version’s release notes to your users. ReleaseNotesKit uses the iTunesSearchAPI to access information about the app. It has methods for caching data, presenting once on a version change, accessing just the data, and presenting the sheet without any preconditions.

Configuration

ReleaseNotesKit can be initialized using:

ReleaseNotesKit.shared.setApp(with: "1548193451") //Replace with your app's ID

Ideally, you'd like to set this once per app launch. Therefore, a good place to set this code would be in your App's AppDelegate file.

Usage

Note: Before accessing any of ReleaseNotesKit’s methods, you have to initialize the shared instance with the app ID. Failure to do this will throw an assertion failure during DEBUG and will do nothing during PROD.

ReleaseNotesKit can provide you both the data in a Swift Struct and also present a sheet with the data in a pre-styled format.

Just the data

To access just the data call parseCacheOrFetchNewData. This method has a default parameter precondition that is set to false by default. For simply accessing the data, precondition can remain false. This check is useful for our subsequent usage types.

ReleaseNotesKit.shared.parseCacheOrFetchNewData { result in
    switch result {
    case .success(let response):
        print(response.releaseNotes)
    case .failure(let error):
        print(error.rawValue)
    }
}

The completion returns a Swift Result type with ITunesLookupResult for the success case and ReleaseNotesError in case of failure. ReleaseNotesError is defined in the following way:

enum ReleaseNotesError: String, Error {
    case malformedURL
    case malformedData
    case parsingFailure
    case noResults
}

Let’s quickly go over each of these cases and what they mean so that it’ll be easy for you to handle it in your code:

  • malformedURL: The iTunesSearchAPI’s URL failed to get constructed. This will never happen if a properly formatted App ID is passed in the singleton’s setApp method.
  • malformedData: The data that is returned from the iTunesSearchAPI is corrupted or not readable.
  • parsingFailure: JSONDecoder failed to parse the data into ITunesLookup.
  • noResults: There was no available results returned for this particular appID. Please check if the appID is correct or if the app is brand new, please wait for a few hours for AppStore to index your app.

Presenting the ReleaseNotesView for the first time

ReleaseNotesKit can present the ReleaseNotesView when the version changes. To present the sheet once per version update, you can call presentReleaseNotesViewOnVersionChange.

ReleaseNotesKit.shared.presentReleaseNotesViewOnVersionChange()

There’s two checks that happen in this method:

guard let lastVersionSheetShownFor = UserDefaults.standard.string(forKey: "lastVersionSheetShownFor") else { ... }

In this first case, we check if the UserDefaults string for lastVersionSheetShownFor is nil which can happen when the user has installed the app for the first time.

result.currentVersion != Bundle.main.releaseVersionNumber || String(result.appID ?? 0) != self.appID
  • Current version stored in the cached response != The installed app's version
  • The cached lookup's appID is different than the set app ID.

Presenting ReleaseNotesView without Preconditions

It is possible to present the ReleaseNotesView without any version check preconditions. To call this, simply call presentReleaseNotesView. You may choose to pass a controller: UIViewController or let it be nil and the framework will access the UIApplication’s top view controller and present the ReleaseNotesView on that top controller.

ReleaseNotesKit.shared.presentReleaseNotesView(in: self)

Or, without the controller to present.

ReleaseNotesKit.shared.presentReleaseNotesView()

Testing

There has been some manual testing done by myself. However, I am looking for contributions that will add a good testing suite. If you’re willing, please feel free to open a PR!

Like the framework?

If you like ReleaseNotesKit please consider buying me a coffee 🥰

Contribution

Contributions are always welcome. Please follow the following convention if you’re contributing:

NameOfFile: Changes Made One commit per feature For issue fixes: #IssueNumber NameOfFile: ChangesMade

License

This project is licensed under the MIT License - see the LICENSE file for details

Apps using ReleaseNotesKit

If you’re using ReleaseNotesKit in your app please open a PR to edit this Readme. I’ll be happy to include you in this list :D

You might also like...
A SwiftUI view that enables you to properly present a UIActivityViewController. (iOS)

ActivityView Also available as a part of my SwiftUI+ Collection – just add it to Xcode 13+ A SwiftUI view that enables you to properly present a UIAct

Portfolio application developed to present my skills.
Portfolio application developed to present my skills.

CatsApp-project Portfolio application developed to present my skills. CatsApp has the following functionality: it takes information (URL of a picture)

Guide users through your SwiftUI app with coach marks
Guide users through your SwiftUI app with coach marks

Guide users through your SwiftUI app with coach marks

An unofficial version of the Sandwiches app and pre-built materials similar to those used in the Introduction to SwiftUI session video from WWDC20

Unofficial Sandwiches The WWDC20 Session Introduction to SwiftUI provides a tutorial-like walk-through of building a list-detail SwiftUI app from scra

Version of PopcornTime app for iOS based on libtorrent and MobileVLCKit.
Version of PopcornTime app for iOS based on libtorrent and MobileVLCKit.

PopcornTime for iOS Version of PopcornTime app for iOS based on libtorrent and MobileVLCKit. There is still a lot of work to do, but in most cases it

Beers is a simple experimental app implemented using the new amazing SwiftUI.
Beers is a simple experimental app implemented using the new amazing SwiftUI.

Beers is a simple experimental app implemented using the new amazing SwiftUI. The app shows a list of beers fetched from Punk API

A simple todo app which aims to demonstrate some new concepts from SwiftUI 3
A simple todo app which aims to demonstrate some new concepts from SwiftUI 3

TodoAppSwiftUI3 A simple todo app which aims to demonstrate some new concepts from SwiftUI 3 Description This is a simple todo app built to demonstrat

iOS version of emitron

emitron (iOS) emitron is the code name for the raywenderlich.com app. This repo contains the code for the iOS version of the app. Contributing To cont

Recreating a fully functional version of iOS 4 in SwiftUI.
Recreating a fully functional version of iOS 4 in SwiftUI.

Updates: Version 1.0 is currently available 🎉 While I work on fixing an issue in Xcode 12.5+ with LazyVGrid, I recommend you build using Xcode 12.4 a

Owner
Swapnanil Dhol
21, WWDC '21, '20, '19 Scholar, GSoC 2020 with VideoLAN (VLC), iOS Developer, Aviation enthusiast.
Swapnanil Dhol
A tiny app that will check your recent subscriptions on RevenueCat and will

Meow Let your RevenueCat talk Download Credits Big thanks to: RxSwift KeychainAccess Popover Notice of Non-Affiliation and Disclaimer We are not affil

2Stable 22 Jul 14, 2022
New version of CardinalKit based on the Swift Package Manager and a modularized architecture.

CardinalKit Open-source framework for rapid development of modern, interoperable digital health applications. Contributing Contributions to this proje

Stanford Biodesign for Digital Health 3 Dec 3, 2022
This is my first SwiftUI project, as I decided not to release it I made the codebase available here for anyone to take a look at.

Sunshine This is my first SwiftUI project, as I decided not to release it to the App Store. I made the codebase available here for anyone to take a lo

Maxime Heckel 20 Dec 14, 2022
A MacOS app created to annoy users so users will go to bed during bedtime hours

A MacOS app created to annoy users so users will go to bed during bedtime hours. Developed for me as a school project.

Helen Dun 1 Jan 17, 2022
MapApp - You can save the location of the places you go on the map and add names and notes

MapApp - You can save the location of the places you go on the map and add names and notes

Yağız Savran 3 Feb 1, 2022
WeHobby is an IOS application which aims to facilitate the discovery of new hobbies while creating links between users.

???? WeHobby (EN) WeHobby is an IOS application which aims to facilitate the discovery of new hobbies while creating links between users. The issues t

Thomas 2 Dec 8, 2022
content for Using Combine - notes on learning Combine with UIKit and SwiftUI

SwiftUI-Notes A collection of notes, project pieces, playgrounds and ideas on learning and using SwiftUI and Combine. Changes, corrections, and feedba

Joseph Heck 1.7k Dec 27, 2022
FSNotes is modern notes manager for macOS and iOS.

FSNotes FSNotes is modern notes manager for macOS and iOS. macOS app Key features Markdown-first. Also supports any plaintext and RTF files. Fast and

null 5.3k Dec 29, 2022
A functional, simplistic quick notes app, built in Swift for iOS

iOS QNApp Documentation Built for iOS 14 and above in XCode 13.1 Takes user input and stores in a note, can be modified at any time Dark mode and acce

itbarsoum 0 Jan 3, 2022
Notes App using Core Data for persisting the data ✨

Notes Notes app where we can save and manage our daily notes. App usage The app allow us to add new notes We can delete our existing notes We can edit

Chris 0 Nov 13, 2021