Files
GiteaIssue/Shared/Settings.swift
T
Claude 74e03c4e10 Initial commit — iOS share extension for filing Gitea issues
Two-target Xcode project (xcodegen spec). The GiteaIssue container app
holds the base URL + personal access token in a shared keychain group;
the GiteaIssueShare extension reads them, surfaces a repo picker (with
recents) and a title/notes form, then creates the issue, uploads the
screenshot as an asset, and patches the body to embed it inline.

Min iOS 26.0, signing team V3PF3M6B6U.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 23:15:43 -05:00

27 lines
722 B
Swift

import Foundation
enum AppSettings {
static let appGroup = "group.com.treytartt.GiteaIssue"
private static let baseURLKey = "gitea.baseURL"
private static let tokenKey = "gitea.token"
static var baseURL: String {
get { Keychain.read(baseURLKey) ?? "https://gitea.treytartt.com" }
set { Keychain.write(baseURLKey, value: newValue) }
}
static var token: String {
get { Keychain.read(tokenKey) ?? "" }
set { Keychain.write(tokenKey, value: newValue) }
}
static var isConfigured: Bool {
!token.isEmpty && URL(string: baseURL) != nil
}
static var sharedDefaults: UserDefaults {
UserDefaults(suiteName: appGroup) ?? .standard
}
}