Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
79f1c5995e
commit
658ee47328
@ -404,6 +404,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 6R7KLBPBLZ;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
@ -436,6 +437,7 @@
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
DEVELOPMENT_TEAM = 6R7KLBPBLZ;
|
||||
ENABLE_PREVIEWS = YES;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<key>SecureStorgageSample.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>1</integer>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
|
||||
@ -14,6 +14,7 @@ struct EncryptedStorageDemo: View {
|
||||
@State private var statusMessage = ""
|
||||
@State private var isLoading = false
|
||||
@State private var iterations = 10_000
|
||||
@FocusState private var isFieldFocused: Bool
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@ -26,6 +27,7 @@ struct EncryptedStorageDemo: View {
|
||||
Section("Add Log Entry") {
|
||||
TextField("Enter log message", text: $logEntry, axis: .vertical)
|
||||
.lineLimit(3, reservesSpace: true)
|
||||
.focused($isFieldFocused)
|
||||
|
||||
Stepper("PBKDF2 Iterations: \(iterations)", value: $iterations, in: 1000...100000, step: 1000)
|
||||
.font(.caption)
|
||||
@ -99,6 +101,14 @@ struct EncryptedStorageDemo: View {
|
||||
}
|
||||
.navigationTitle("Encrypted Storage")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .keyboard) {
|
||||
Spacer()
|
||||
Button("Done") {
|
||||
isFieldFocused = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func addLogEntry() {
|
||||
|
||||
@ -16,6 +16,7 @@ struct FileSystemDemo: View {
|
||||
@State private var statusMessage = ""
|
||||
@State private var isLoading = false
|
||||
@State private var selectedDirectory: FileDirectory = .documents
|
||||
@FocusState private var isFieldFocused: Bool
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@ -27,11 +28,14 @@ struct FileSystemDemo: View {
|
||||
|
||||
Section("Profile Data") {
|
||||
TextField("Name", text: $profileName)
|
||||
.focused($isFieldFocused)
|
||||
TextField("Email", text: $profileEmail)
|
||||
.keyboardType(.emailAddress)
|
||||
.textContentType(.emailAddress)
|
||||
.focused($isFieldFocused)
|
||||
TextField("Age", text: $profileAge)
|
||||
.keyboardType(.numberPad)
|
||||
.focused($isFieldFocused)
|
||||
}
|
||||
|
||||
Section("Storage Location") {
|
||||
@ -100,6 +104,14 @@ struct FileSystemDemo: View {
|
||||
}
|
||||
.navigationTitle("File System")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .keyboard) {
|
||||
Spacer()
|
||||
Button("Done") {
|
||||
isFieldFocused = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func saveProfile() {
|
||||
|
||||
@ -16,6 +16,7 @@ struct KeychainDemo: View {
|
||||
@State private var isLoading = false
|
||||
@State private var selectedAccessibility: KeychainAccessibility = .afterFirstUnlock
|
||||
@State private var selectedAccessControl: KeychainAccessControl? = nil
|
||||
@FocusState private var focusedField: Bool
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@ -27,7 +28,9 @@ struct KeychainDemo: View {
|
||||
|
||||
Section("Credentials") {
|
||||
TextField("Username", text: $username)
|
||||
.focused($focusedField)
|
||||
SecureField("Password", text: $password)
|
||||
.focused($focusedField)
|
||||
}
|
||||
|
||||
Section("Accessibility") {
|
||||
@ -100,6 +103,14 @@ struct KeychainDemo: View {
|
||||
}
|
||||
.navigationTitle("Keychain")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .keyboard) {
|
||||
Spacer()
|
||||
Button("Done") {
|
||||
focusedField = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func saveCredentials() {
|
||||
|
||||
@ -15,6 +15,7 @@ struct PlatformSyncDemo: View {
|
||||
@State private var isLoading = false
|
||||
@State private var selectedPlatform: PlatformAvailability = .all
|
||||
@State private var selectedSync: SyncPolicy = .never
|
||||
@FocusState private var isFieldFocused: Bool
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@ -49,6 +50,7 @@ struct PlatformSyncDemo: View {
|
||||
|
||||
Section("Test Data") {
|
||||
TextField("Enter a value to store", text: $settingValue)
|
||||
.focused($isFieldFocused)
|
||||
}
|
||||
|
||||
Section("Actions") {
|
||||
@ -102,6 +104,14 @@ struct PlatformSyncDemo: View {
|
||||
}
|
||||
.navigationTitle("Platform & Sync")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .keyboard) {
|
||||
Spacer()
|
||||
Button("Done") {
|
||||
isFieldFocused = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
|
||||
@ -13,6 +13,7 @@ struct UserDefaultsDemo: View {
|
||||
@State private var storedValue = ""
|
||||
@State private var statusMessage = ""
|
||||
@State private var isLoading = false
|
||||
@FocusState private var isInputFocused: Bool
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@ -25,6 +26,7 @@ struct UserDefaultsDemo: View {
|
||||
Section("Store Value") {
|
||||
TextField("Enter a value", text: $inputText)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
.focused($isInputFocused)
|
||||
|
||||
Button(action: saveValue) {
|
||||
HStack {
|
||||
@ -83,6 +85,14 @@ struct UserDefaultsDemo: View {
|
||||
}
|
||||
.navigationTitle("UserDefaults")
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar {
|
||||
ToolbarItemGroup(placement: .keyboard) {
|
||||
Spacer()
|
||||
Button("Done") {
|
||||
isInputFocused = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func saveValue() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user