Contributions are welcome — bug reports, features, translations, or doc improvements.
- 🐛 Report bugs — open an issue with reproduction steps
- 💡 Request features — describe the use case, not just the solution
- 🔧 Submit pull requests — see the PR Guidelines below
- 📚 Improve docs — typos, clarifications, examples
- 🌍 Add translations — see existing translations under
README/
git clone https://github.com/1998code/SwiftNEWKit.git
cd SwiftNEWKit
open Package.swift # in XcodeTest your changes against as many platforms as possible (iOS, macOS, visionOS, tvOS, watchOS).
- Keep PRs focused. One feature or bug fix per PR. Avoid bundling unrelated refactors, formatting changes, or dependency updates.
- Don't reformat unrelated code. If a file uses 4-space indentation, don't switch it to 2 in a feature PR. Style-only changes belong in their own PR.
- Maintain backward compatibility. New initializer parameters should have defaults. Public API removals require a deprecation cycle.
- Match the minimum platform versions declared in
Package.swiftand the@availableannotations. - Test on multiple platforms when the change touches view code or platform-conditional code (
#if os(...)). - Localization changes — when adding/renaming a string, update all locales in
Localizable.xcstrings(or mark themneeds_review).
Sources/SwiftNEW/
├── SwiftNEW.swift # Main struct + init overloads
├── Model.swift # Vmodel, Model (Codable, Sendable)
├── Bundle+Ext.swift # App icon helper
├── Localizable.xcstrings # Localization catalog
├── Views/
│ ├── SwiftNEW+View.swift # body + presentation modifiers
│ ├── Sheets/
│ │ ├── CurrentVersionSheet.swift
│ │ └── HistorySheet.swift
│ └── Components/
│ ├── HeaderView.swift
│ └── ButtonComponents.swift
├── Extensions/
│ └── SwiftNEW+Functions.swift # compareVersion, loadData, drop
├── Styles/
│ ├── AppIconView.swift
│ ├── MeshView.swift # Mesh gradient background
│ └── NoiseView.swift # Noise overlay
└── Animations/
├── SnowfallView.swift # .christmas effect
└── FloatingParticlesView.swift # .particles effect
- Core:
SwiftNEWstruct holds all configuration via@Bindings; multipleinitoverloads accept either direct values or bindings (cross-platform variants for iOS/macOS/watchOS/tvOS/visionOS). - View layer:
bodyresolves to either an embedded view or a button that triggers a sheet / fullScreenCover. Sheets composeMeshView+ optionalSnowfallView/FloatingParticlesViewon top ofsheetCurrentorsheetHistory. - Data:
loadData()parses local or remote JSON into[Vmodel]using Swift Concurrency.compareVersion()readsBundle.version/Bundle.buildand togglesshowon mismatch.
- Check that
showis bound to a@State(or equivalent)Booland gets set totrue. - Confirm the data source resolves: local JSON exists in the bundle, or the remote URL returns 200 with the expected schema.
- Local: the file must be added to the target (not just the project) so it ends up in the bundle.
- Remote: check the URL scheme starts with
http/httpsand that the device has network access. - Schema: the JSON must be a top-level array of
Vmodel. Validate withxcrun swift runor any JSON linter.
- Clean build folder (⌘⇧K) and resolve packages (File → Packages → Reset Package Caches).
- Confirm Xcode and target deployment versions meet the minimums in PLATFORM.md.
- 💬 GitHub Discussions — questions, ideas, community
- 🐛 GitHub Issues — bug reports, feature requests