diff options
| author | Christian Cleberg <[email protected]> | 2026-07-25 11:35:46 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-07-25 11:49:23 -0500 |
| commit | 074052763638a36e274e18d00f5f5ab21846be28 (patch) | |
| tree | 9daf0a4c919fa8dc79c24b629157af45577ed4e4 /DomainDig/AppLinks.swift | |
| parent | b824dae8ea16d20d75136687a7c59bc7b01afe27 (diff) | |
| download | domain-dig-074052763638a36e274e18d00f5f5ab21846be28.tar.gz domain-dig-074052763638a36e274e18d00f5f5ab21846be28.tar.bz2 domain-dig-074052763638a36e274e18d00f5f5ab21846be28.zip | |
feat: enrich Settings → App Info with metadata & resource links (#56)
Replaces the three-row App Info screen with a full About/Resources/Support/
Legal layout, driven by a declarative AppInfoRow model with all URLs centralized
in one AppLinks namespace.
- About: Version now shows "5.0.0 (build N)" (CFBundleShortVersionString +
CFBundleVersion), plus Storage, Backup Schema, and Minimum iOS (17.6).
- Resources: What's New (bundled ReleaseNotes.json sheet, no network),
Documentation & FAQ, Source Code, Privacy Policy, and Acknowledgements
("no third-party dependencies" + MIT license).
- Support: Report an Issue (a sheet that shows the locally-assembled
version/OS/device diagnostics before offering Email or GitHub — nothing is
collected silently) and Contact (mailto).
- Support the App: Rate (SwiftUI's @Environment(\.requestReview), which handles
the scene internally and respects Apple's throttling — the modern, safer
equivalent of the issue's SKStoreReviewController + connectedScenes path) and
Share (ShareLink to the App Store listing).
- Legal: copyright footer with the current year.
External rows use Link/openURL with an "opens outside the app" accessibility
hint; the screen is standard adaptive Form controls with semantic colors, so it
tracks Dynamic Type and light/dark automatically.
New files (AppLinks, AppInfo, ReleaseNotes[.swift/.json], AppInfoView) auto-
compile/bundle via the synchronized DomainDig/ group. AppInfoTests covers the
mailto builder, version format, diagnostics contents, and that the bundled notes
ship and parse. Unit suite green.
Placeholder pending the App Store listing: AppLinks.appStoreID (the review/share
URLs derive from it), flagged with a TODO.
Diffstat (limited to 'DomainDig/AppLinks.swift')
| -rw-r--r-- | DomainDig/AppLinks.swift | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/DomainDig/AppLinks.swift b/DomainDig/AppLinks.swift new file mode 100644 index 0000000..39c9036 --- /dev/null +++ b/DomainDig/AppLinks.swift @@ -0,0 +1,34 @@ +import Foundation + +/// Centralized external destinations, kept in one place so URLs and the App Store +/// identifier can be swapped without touching any view. +/// +/// TODO(release): `appStoreID` is a placeholder until the App Store listing is +/// live — the listing/review/share URLs derive from it. `documentation` points +/// at the repository README for now; swap in a dedicated docs site if one lands. +enum AppLinks { + /// App Store numeric identifier. Placeholder until the listing is published. + static let appStoreID = "0000000000" + + static let sourceCode = url("https://github.com/zerolabsco/domain-dig") + static let documentation = url("https://github.com/zerolabsco/domain-dig#readme") + static let privacyPolicy = url("https://zerolabs.sh/domaindig/privacy-policy/") + static let supportEmail = "[email protected]" + + static var appStoreListing: URL { url("https://apps.apple.com/app/id\(appStoreID)") } + static var writeReview: URL { url("https://apps.apple.com/app/id\(appStoreID)?action=write-review") } + + static var copyright: String { + let year = Calendar.current.component(.year, from: Date()) + return "© \(year) Christian Cleberg" + } + + /// Builds URLs from developer-controlled literals; a malformed literal is a + /// programming error, surfaced loudly in development rather than force-unwrapped. + private static func url(_ string: String) -> URL { + guard let url = URL(string: string) else { + preconditionFailure("Invalid AppLinks URL literal: \(string)") + } + return url + } +} |
