New (Core) Features | Version |
---|---|
Mesh Gradient and Linear Gradient Background | 5.3.0 |
Apple visionOS & Vision Pro | 4.1.0 |
Auto trigger/pop-up .sheet when Version / Build changes | 4.0.0 |
Version Number in x.y.z and/or x.y | 4.0.0 |
Remote Drop Notification | 3.5.0 |
Firebase Real-Time Database | 3.0.0 |
Remote JSON File | 3.0.0 |
Versioning + View History | 2.0.0 |
Allows for ALL Use Cases including Commercial / Non-profit | - |
Simple Model, Easy to Modify and Reuse | - |
Simple Binding and Passing Data | - |
Instant Loading from Local Storage | - |
Light Native | Dark Native |
![]() |
![]() ![]() |
---|---|
History View (2.0.0) | App Icon (3.9.6) [Vertical / Horizontal] |
![]() |
![]() |
---|---|
Support VisionOS (4.1.0 or above) | Mesh Gradient Background (5.3.0 or above) |
Path: ./Demo
(Xcode Project with SwiftUI)
Tested on | Latest | Compatible |
---|---|---|
iOS | 18.4 | > 14 |
iPadOS | 18.2 | > 14 |
macOS | 15.2 | > 11 |
visionOS | 2 | > 1 |
Tested on | Compatible |
---|---|
Xcode | > 13.4 (13F17a) |
macOS | > 12.3.1 (21E258) |
Tutorial available on Medium: https://bit.ly/3NOvJB8 or below.
Steps | Description | Screenshot |
---|---|---|
1 | Navigate to root project | ![]() |
2 | Select Project | ![]() |
3 | Select Package Dependencies | ![]() |
4 | Click + and paste https://github.com/1998code/SwiftNEWKit to the searchbox |
![]() |
5L | Create a new local file called data.json |
You may copy this JSON sample. |
5R | You can use remote JSON / firebase realtime database too. | Sample: https://testground-a937f-default-rtdb.firebaseio.com/0.json?print=pretty |
- Import SwiftNEWKit.
import SwiftNEW
- Add States before
body
or anysome View
.
var | Suggested | Options | Type |
---|---|---|---|
showNew * | false | false, true | Bool |
align | .center | .leading, .center, .trailing | HorizontalAlignment |
color | .accentColor | All Colors Supported | Color |
size | "simple" | "invisible", "mini", "simple" | String |
labelColor | UIColor.systemBackground or NSColor.windowBackgroundColor | All Colors Supported | Color |
label | "Show Release Note" | All Strings | String |
labelImage | "arrow.up.circle.fill" | All SF Symbols | String |
history | true | true, false | Bool |
data | "data" or "https://.../{}.json" | "{LOCAL_JSON_FILE}" or Remote | String |
showDrop | false | false, true | Bool |
mesh | true | false, true | Bool |
// Required
@State var showNew: Bool = false
// Optional (5.2.0 or above)
@State var align: HorizontalAlignment = .center
@State var color: Color = .accentColor
@State var size: String = "normal"
#if os(iOS)
@State var labelColor: Color = Color(UIColor.systemBackground)
#elseif os(macOS)
@State var labelColor: Color = Color(NSColor.windowBackgroundColor)
#endif
@State var label: String = "Show Release Note"
@State var labelImage: String = "arrow.up.circle.fill"
@State var history: Bool = true
@State var data: String = "data"
@State var showDrop: Bool = false
@State var mesh: Bool = false
- Then, paste this code inside
body
or anysome View
.
// Simplified with default options in 5.2.0 or above
SwiftNEW(show: $showNew)
// 5.1.0 or below
SwiftNEW(show: $showNew, align: $align, color: $color, size: $size, labelColor: $labelColor, label: $label, labelImage: $labelImage, history: $history, data: $data, showDrop: $showDrop)
Instead of using separate states, inline states work too. (No longer required after 5.2.0)
*Show Bool
cannot be inline.
SwiftNEW(show: $showNew, align: .constant(.center), color: .constant(.accentColor), size: .constant("normal"), labelColor: .constant(Color(UIColor.systemBackground)), label: .constant("Show Release Note"), labelImage: .constant("arrow.up.circle.fill"), history: .constant(true), data: .constant("data"), showDrop: .constant(false))
- Your code should look similar to the following, including the minimum features and default styles.
struct ContentView: View {
@State var showNew: Bool = false
var body: some View {
SwiftNEW(show: $showNew)
}
}
- The below code is just for reference only. You don't need to copy the structure or model.
public struct Vmodel: Codable, Hashable {
var version: String
var new: [Model]
}
public struct Model: Codable, Hashable {
var icon: String
var title: String
var subtitle: String
var body: String
}
Copy the JSON sample to data.json
file (If you don't have it, create a new file.)
[
{
"version": "1.2",
"new": [
{
"body": "Available for iOS 16, iPadOS 16, macOS 13",
"icon": "hammer.fill",
"subtitle": "Broken UI",
"title": "Bug fixes"
},
{
"body": "Direct load via remote storage. Easy!",
"icon": "square.and.arrow.down.fill",
"subtitle": "Supported",
"title": "Firebase Remote"
},
{
"body": "Free and open source! Created by Ming with ❤️🔥",
"icon": "macpro.gen3.server",
"subtitle": "Design",
"title": "Serverless"
},
{
"body": "Pull requests and make it better for everyone!",
"icon": "arrow.triangle.pull",
"subtitle": "Together",
"title": "Contribute"
}
]
},
{
"version": "1.1",
"new": [
{
"body": "Available for iOS 16, iPadOS 16, macOS 13",
"icon": "hammer.fill",
"subtitle": "Broken UI",
"title": "Bug fixes"
},
{
"body": "Direct load via local storage. Super fast!",
"icon": "square.and.arrow.down.fill",
"subtitle": "Supported",
"title": "Local File"
},
{
"body": "Free and open source! Created by Ming with ❤️🔥",
"icon": "macpro.gen3.server",
"subtitle": "Design",
"title": "Serverless"
},
{
"body": "Pull requests and make it better for everyone!",
"icon": "arrow.triangle.pull",
"subtitle": "Together",
"title": "Contribute"
}
]
}
]
Translation (i18n) Sample Available in v3.9.7
or above
- Please report bugs in the Issues section.
- If you want to discuss future roadmap or contribution, please find on Discussions.
Q1. Why didn’t the sheet pop up, show loading, or display a blank screen?
A1. First, ensure that the latest version in JSON matches your app version. If you are using a local data.json file, check for any missing commas(,) or typos that could make the JSON invalid.
If you are using remote data (such as Firebase), confirm that the JSON structure is the same as the provided example.
Q2. How can I contribute to the project?
A2. Simply pull a request, and the admin will review your code. If everything is okay, your changes will be merged and reflected in the next minor version.
Q3. Can I use it in Educational (include Student's Homework, Class's demo) or NGO or Commerical Projects?
A3. YES. This project is under the license of MIT. Feel free to play it :)
MIT