Download WatchApp/WatchApp Watch App/Pages/SettingView.swift from posix4e/brain: direct link, hf CLI and curl.
- Browser
- Download file 875 Bytes
-
https://huggingface.co/spaces/posix4e/brain/resolve/main/WatchApp/WatchApp%20Watch%20App/Pages/SettingView.swift
- Command line
-
hf download 'hf://spaces/posix4e/brain/WatchApp/WatchApp Watch App/Pages/SettingView.swift'
-
curl -L -o SettingView.swift https://huggingface.co/spaces/posix4e/brain/resolve/main/WatchApp/WatchApp%20Watch%20App/Pages/SettingView.swift
875 Bytes
| import SwiftUI | |
| import KeychainSwift | |
| struct SettingView: View { | |
| private var uuid: String = Constants.DEFAULT_UUID | |
| var body: some View { | |
| VStack { | |
| TextField("uuid", text: $uuid) | |
| .foregroundColor(.white) | |
| .font(.system(size: 20)) | |
| .padding() | |
| HStack { | |
| Spacer() | |
| Button(action: { | |
| let keychain = KeychainSwift() | |
| keychain.set("\($uuid)", forKey: "uuid") | |
| }) { | |
| Text("Save") | |
| } | |
| Spacer() | |
| Button(action: {}) { | |
| Text("Cancel") | |
| } | |
| Spacer() | |
| } | |
| } | |
| } | |
| } | |
| struct SettingView_Previews: PreviewProvider { | |
| static var previews: some View { | |
| SettingView() | |
| } | |
| } | |