This file contains hidden or 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
| struct AlertAction { | |
| let title: String | |
| var role: ButtonRole? = .none | |
| let action: (() -> Void) | |
| } | |
| struct AlertItem { | |
| let title: String | |
| let message: String | |
| let actions: [AlertAction] |
This file contains hidden or 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
| extension Result where Failure == ParseError { | |
| func checkError(messageIfNotError: String, type: ParseErrorType) { | |
| switch self { | |
| case .success(_): | |
| XCTFail(messageIfNotError) | |
| case let .failure(error): | |
| if error.type != type { | |
| XCTFail("Should have thrown \(type.rawValue) but did \(error.type)") | |
| } | |
| } |
This file contains hidden or 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
| struct Selectables<Data, ID: Hashable, Content>: View where Content: View { | |
| let data: [Data] | |
| @Binding var selectedIds: [ID] | |
| let id: KeyPath<Data, ID> | |
| let content: (Data, Binding<Bool>) -> Content | |
| init(_ data: [Data], selectedIds: Binding<[ID]>, id: KeyPath<Data, ID>, @ViewBuilder content: @escaping (Data, Binding<Bool>) -> Content) { | |
| self.data = data | |
| self._selectedIds = selectedIds | |
| self.id = id |
OlderNewer