Created
January 28, 2025 18:16
-
-
Save VAndrJ/e6eb21fbccb1c08f497efa2ef7c6dbff to your computer and use it in GitHub Desktop.
Typed throws issue in iOS lower 18
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
import SwiftUI | |
struct ContentView: View { | |
@StateObject private var someClass = SomeClass(someInjectedFunction: { _ in }) | |
var body: some View { | |
Text("Example") | |
} | |
} | |
enum AwesomeError: Error { | |
case dooom | |
} | |
@MainActor | |
class SomeClass: ObservableObject { | |
let someInjectedFunction: (Int) throws(AwesomeError) -> Void | |
init(someInjectedFunction: @escaping (Int) throws(AwesomeError) -> Void) { | |
self.someInjectedFunction = someInjectedFunction | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment