-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27d3c64
commit bf5e881
Showing
13 changed files
with
48 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
|
||
import SwiftUI | ||
|
||
#warning("TODO") | ||
/* | ||
struct BSWInterfaceKit_SwiftUILibrary: LibraryContentProvider { | ||
|
||
public var views: [LibraryItem] { | ||
return [ | ||
LibraryItem(PhotoView(photo: .emptyPhoto()), title: "Photo View", category: .other, matchingSignature: "photovie"), | ||
LibraryItem(AsyncButton("", action: {}), title: "Async Button", category: .control, matchingSignature: "asyncbutton") | ||
] | ||
} | ||
} | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
import UIKit | ||
|
||
@MainActor | ||
public enum TextFieldAlertController { | ||
|
||
/// Creates an alert with a `UITextField` to capture user input. | ||
|
@@ -25,7 +26,7 @@ public enum TextFieldAlertController { | |
placeholder: String? = nil, | ||
initialValue: String? = nil, | ||
textContentType: UITextContentType? = nil, | ||
actionValidator: @escaping ((String) -> Bool) = { $0.count > 0 }, | ||
actionValidator: @escaping @Sendable ((String) -> Bool) = { $0.count > 0 }, | ||
Check failure on line 29 in Sources/BSWInterfaceKit/ViewControllers/TextFieldAlertController.swift GitHub Actions / build
|
||
onAction: @escaping (String?) -> (), | ||
onCancelAction: (() -> ())? = nil) -> UIViewController { | ||
let alertVC = UIAlertController(title: title, message: subtitle, preferredStyle: .alert) | ||
|
@@ -56,8 +57,10 @@ public enum TextFieldAlertController { | |
$0.isSecureTextEntry = (textContentType == .password) | ||
observation = NotificationCenter.default.addObserver(forName: UITextField.textDidChangeNotification, object: $0, queue: OperationQueue.main) { [weak action] (note) in | ||
guard let t = note.object as? UITextField else { return } | ||
textField = t | ||
action?.isEnabled = actionValidator(t.text ?? "") | ||
MainActor.assumeIsolated { | ||
textField = t | ||
action?.isEnabled = actionValidator(t.text ?? "") | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters