summaryrefslogtreecommitdiff
path: root/DomainDig/AppLinks.swift
diff options
context:
space:
mode:
Diffstat (limited to 'DomainDig/AppLinks.swift')
-rw-r--r--DomainDig/AppLinks.swift34
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
+ }
+}