Skip to content

1998code/SwiftNEWKit

Repository files navigation

SNK

SwiftNEW

StableBetaValidate JSON FilesSwift Version

PlatformsLicense

image

A modern, SwiftUI-native "What's New" presentation framework designed for all Apple platforms. Featuring beautiful animations, gradient backgrounds, remote data loading, and comprehensive customization options for creating engaging release notes and feature announcements.

📋 Table of Contents

🎨 Preview & Gallery

CleanShot 2022-06-11 at 22 54 15@2x

Light & Dark Mode

IMG_3472IMG_3471
Light NativeDark Native

Advanced Features

Simulator Screen Shot - iPhone 13 Pro MaxCleanShot 2022-12-11 at 12 46 30@2x
History View (2.0.0+)App Icon Support (3.9.6+)

Platform Support

CleanShot 2023-06-22 at 14 24 07@2xScreenshot 2024-07-01 at 10 18 33 PM
VisionOS Support (4.1.0+)Mesh Gradient Background (5.3.0+)

✨ Features

FeatureVersionDescription
🎨 Glass Morphism Effects5.5.0+Modern glass blur effects with customizable transparency
🌈 Mesh & Linear Gradients5.3.0+Beautiful animated gradient backgrounds
🥽 visionOS & Vision Pro4.1.0+Native spatial computing support
🔄 Auto-trigger on Version Change4.0.0+Automatically shows when app version or build changes
📊 Flexible Version Numbers4.0.0+Supports semantic versioning (x.y.z) and simplified (x.y) formats
🎄 Special Effects3.9.0+Seasonal animations (Christmas snowfall)
📱 Drop Notifications3.5.0+iOS-style notification banners
🔥 Firebase Real-Time Database3.0.0+Live content updates from Firebase
🌐 Remote JSON Support3.0.0+Load content from any REST API endpoint
📚 Version History2.0.0+Browse all previous releases with navigation

🎯 Quick Start

Installation via Swift Package Manager

Add SwiftNEW to your project by adding the package URL in Xcode:

https://github.com/1998code/SwiftNEWKit 

Basic Implementation

  1. Import the framework
import SwiftNEW
  1. Create a simple "What's New" view
structContentView:View{@StateprivatevarshowNew=falsevarbody:someView{VStack{Text("My App").font(.largeTitle)SwiftNEW(show: $showNew)}}}
  1. Add your content Create a data.json file in your app bundle with your release notes:
[{"version": "1.0", "new": [{"icon": "star.fill", "title": "Welcome", "subtitle": "Get Started", "body": "Thanks for downloading our app! Here's what's new." } ] } ]

Advanced Example with Customization

structContentView:View{@StateprivatevarshowNew=falsevarbody:someView{SwiftNEW( show: $showNew, color:.constant(.blue), size:.constant("normal"), label:.constant("What's New"), labelImage:.constant("sparkles"), history:.constant(true), mesh:.constant(true), glass:.constant(true))}}

🎨 Preview & Gallery

CleanShot 2022-06-11 at 22 54 15@2x

Light & Dark Mode

IMG_3472IMG_3471
Light NativeDark Native

Advanced Features

Simulator Screen Shot - iPhone 13 Pro MaxCleanShot 2022-12-11 at 12 46 30@2x
History View (2.0.0+)App Icon Support (3.9.6+)

Platform Support

CleanShot 2023-06-22 at 14 24 07@2xScreenshot 2024-07-01 at 10 18 33 PM
VisionOS Support (4.1.0+)Mesh Gradient Background (5.3.0+)

⚙️ Configuration

Available Parameters

ParameterTypeDefaultDescription
show *Binding<Bool>falseControls the presentation state
alignBinding<HorizontalAlignment>.centerContent alignment (.leading, .center, .trailing)
colorBinding<Color>.accentColorPrimary theme color
sizeBinding<String>"simple"Button size: "invisible", "mini", "simple", "normal"
labelColorBinding<Color>System colorButton text color
labelBinding<String>"Show Release Note"Button display text
labelImageBinding<String>"arrow.up.circle.fill"SF Symbol icon name
historyBinding<Bool>trueEnable version history navigation
dataBinding<String>"data"Local JSON filename or remote URL
showDropBinding<Bool>falseUse iOS drop notification style
meshBinding<Bool>trueEnable mesh gradient backgrounds
specialEffectBinding<String>""Special effects: "Christmas" or ""
glassBinding<Bool>trueEnable glass morphism effects

*Required parameter

Configuration Examples

Minimal Setup

SwiftNEW(show: $showNew)

Custom Styling

SwiftNEW( show: $showNew, color:.constant(.purple), size:.constant("normal"), mesh:.constant(true), glass:.constant(true))

Remote Data Source

SwiftNEW( show: $showNew, data:.constant("https://api.example.com/releases.json"))

Drop Notification Style (iOS only)

SwiftNEW( show: $showNew, label:.constant("New Update"), labelImage:.constant("bell.badge"), showDrop:.constant(true))

🔧 Data Sources

SwiftNEW supports multiple data sources for maximum flexibility:

Local JSON Files

Create a JSON file in your app bundle (typically named data.json):

[{"version": "1.2.0", "new": [{"icon": "hammer.fill", "title": "Bug Fixes", "subtitle": "Stability Improvements", "body": "Resolved critical issues and improved overall app performance across all supported platforms." },{"icon": "sparkles", "title": "New Features", "subtitle": "Enhanced Experience", "body": "Introduced exciting new capabilities including improved animations and modern UI components." },{"icon": "shield.checkered", "title": "Security Updates", "subtitle": "Enhanced Protection", "body": "Strengthened security measures and updated encryption protocols for better data protection." } ] } ]

Remote JSON APIs

Load content from any REST API endpoint:

SwiftNEW( show: $showNew, data:.constant("https://api.myapp.com/releases.json"))

Firebase Realtime Database

Direct integration with Firebase:

SwiftNEW( show: $showNew, data:.constant("https://your-project.firebaseio.com/releases.json"))

Data Structure Reference

The JSON structure follows this model:

// Reference only - you don't need to implement this publicstructVmodel:Codable,Hashable{varversion:String // Version number (e.g., "1.2.0") varsubVersion:String? // Optional sub-version or build info varnew:[Model] // Array of release items }publicstructModel:Codable,Hashable{varicon:String // SF Symbol name (e.g., "star.fill") vartitle:String // Feature title varsubtitle:String // Brief description varbody:String // Detailed explanation }

Best Practices

  • Local Files: Best for static content and faster loading
  • Remote APIs: Ideal for dynamic content and A/B testing
  • Firebase: Perfect for real-time updates and content management
  • Version Format: Use semantic versioning (1.2.3) for better organization
  • Content Length: Keep titles short, use body for detailed descriptions

🛠️ Platform Support

Supported Platforms

PlatformLatest TestedMinimum RequiredKey Features
iOS18.215.0+Full feature support, drop notifications, glass effects
iPadOS18.215.0+Optimized layouts, multitasking support
macOS15.214.0+Native macOS styling, menu bar integration
visionOS2.11.0+Spatial computing, immersive presentations
tvOS18.217.0+Remote-friendly navigation, living room UI

Development Requirements

ToolVersionNotes
Xcode15.0+Required for building and development
macOS14.0+Host development environment
Swift5.9+ / 6.1+Language compatibility and features

Feature Availability Matrix

FeatureiOSiPadOSmacOSvisionOStvOS
Basic Presentations
Mesh Gradients
Glass Effects
Drop Notifications
History Navigation
Remote JSON
Special Effects
Auto-versioning

📁 Installation Guide

Follow these steps to add SwiftNEW to your Xcode project:

Step-by-Step Installation

StepActionScreenshot
1Open your Xcode project and select the project fileProject Navigator
2Select your project targetTarget Selection
3Go to "Package Dependencies" tabPackage Dependencies
4Click "+" and paste the repository URLAdd Package
5Choose your data source approachSee Data Sources section

Package URL

https://github.com/1998code/SwiftNEWKit 

Post-Installation Setup

  1. Import the framework in your Swift files:
import SwiftNEW
  1. Create your data source (choose one):

    • Local: Add data.json to your app bundle
    • Remote: Use any JSON API endpoint
    • Firebase: Configure Firebase Realtime Database
  2. Add to your view with minimal configuration:

SwiftNEW(show: $showNewVersion)

🔧 Troubleshooting

Common Issues

SwiftNEW doesn't appear

  • Ensure the show binding is set to true
  • Check that your data source (JSON file or URL) is accessible
  • Verify the JSON format matches the expected structure

Data not loading

  • For local files: Ensure data.json is added to your app bundle
  • For remote URLs: Check network connectivity and URL validity
  • Verify JSON structure matches the sample format

Build errors after installation

  • Clean build folder (⌘+Shift+K)
  • Update to latest Xcode version
  • Ensure minimum platform requirements are met

Performance issues

  • For large datasets, consider pagination
  • Optimize image assets in your JSON data
  • Use remote loading for better memory management

Getting Help

📂 Project Structure

Sources/SwiftNEW/ ├── SwiftNEW.swift # Main struct with initializers ├── Model.swift # Data models (Vmodel, Model) ├── Bundle+Ext.swift # Bundle extensions ├── Localizable.xcstrings # Localization support ├── 📁 Views/ │ ├── SwiftNEW+View.swift # Main body view implementation │ ├── 📁 Sheets/ │ │ ├── CurrentVersionSheet.swift # Current version display │ │ └── HistorySheet.swift # Version history display │ └── 📁 Components/ │ ├── HeaderView.swift # Header components │ └── ButtonComponents.swift # Button components ├── 📁 Extensions/ │ └── SwiftNEW+Functions.swift # Utility functions ├── 📁 Styles/ │ ├── AppIconView.swift # App icon display │ ├── MeshView.swift # Gradient backgrounds │ └── NoiseView.swift # Noise effects └── 📁 Animations/ └── SnowfallView.swift # Special effects (Christmas) 

Architecture Overview

SwiftNEW is built with a modular architecture that separates concerns for better maintainability:

  • Core Components: Main struct and data models
  • View Layer: Presentation components organized by functionality
  • Extensions: Utility functions and framework extensions
  • Styles: Visual components and gradient effects
  • Animations: Special effects and interactive elements

🤝 Contributing

We welcome contributions to SwiftNEW! Here's how you can help:

Ways to Contribute

  • 🐛 Report Bugs: Open an issue with detailed reproduction steps
  • 💡 Request Features: Suggest new features or improvements
  • 🔧 Submit Pull Requests: Fix bugs or implement new features
  • 📚 Improve Documentation: Help make our docs clearer
  • 🌍 Add Translations: Help us support more languages

Development Setup

  1. Fork the repository
  2. Clone your fork locally
  3. Open Package.swift in Xcode
  4. Make your changes
  5. Test thoroughly across platforms
  6. Submit a pull request

Coding Guidelines

  • Follow Swift naming conventions
  • Maintain compatibility with minimum platform versions
  • Add appropriate documentation comments
  • Test on multiple platforms when possible
  • Keep changes focused and atomic

Getting Help

  • 💬 GitHub Discussions - Questions and community support
  • 🐛 GitHub Issues - Bug reports and feature requests
  • 📧 Contact the maintainer for complex questions

📄 License

SwiftNEW is available under the MIT License. See the LICENSE file for details.

🌍 Translations

This documentation is available in multiple languages:

English | 繁中 / 简中 / 粵語 | 日本語 | 한국어

Help us add more languages by submitting translation pull requests!

💖 Supported By

Digital Ocean

Ask DeepWiki

About

Show "Release Note" on SwiftUI [ AI Assistant available below ]

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 6

Languages