mykolaharmash/notelet
mykolaharmash/notelet244
+47/day5
SwiftMobileSwiftUI component for displaying rich release notes inside an app
From the README
Notelet
SwiftUI package for showing rich release notes in iOS apps
[!TIP] Once you're done here, check my other project AppView to get an optimized website for your app. It will boost downloads coming from web search and AI suggestions.
Installation (Swift Package Manager)
- In Xcode, open your app project.
- Go to File → Add Package Dependencies....
- Enter the repo URL into the search.
- Click on "Add package".
- Add
Noteletto your app target.
Usage
Here is a full usage example with comments to get started quickly. Below are more detailed explanations of how the component works and all available APIs.
import SwiftUI
// Import Notelet
import Notelet
/**
* Release notes for different versions of the app.
* There are three supported note types: .list, .media(kind: .image) and .media(kind: .video).
*/
private let notes: [NoteletVersionNotes] = [
.init(
version: "1.2.0",
items: [
.list(
title: "What's new",
rows: [
.init(
symbolSystemName: "wand.and.stars",
title: "New editor tools",
description: "More formatting options with less taps."
),
.init(
symbolSystemName: "lock.shield.fill",
title: "Privacy update",
description: "Sensitive data handling is now stricter."
]
),
.media(
kind: .image,
url: URL(string: ")!,
title: "Updated UI",
description: "Refreshed visuals across key screens."
),
.media(
kind: .video,
url: URL(string: ")!,
title: "Quick walkthrough",
description: "A short clip showing the new flow."
]
),
.init(
version: "1.2.1",
items: [
.media(
kind: .image,
url: URL(string: ")!,
title: "Journal Archive",
description: "Archive entries without deleting them permanently"
]
]
struct ContentView: View {
var body: some View {
Text("Hello, World!")
/**
* Add the sheet to the view hierarchy.
* It takes the full list of notes for all versions
* and the version you'd like to present to the user.
* There are more parameters, described below.
*/
.noteletSheet(
notes: notes,
/**
* `version: .current` takes the current version from the app's bundle,
* and tries to show notes for it if they are present inside `notes`.
* It will also automatically save this version as "viewed" when
* the sheet is dismissed.
*/
version: .current
}
}