|
Hi im getting en error in my code. I tried to use the one from github but it desnt work also :/ Maybe you can find something? I cant move on to challende :/
|
|
|
|
Oh! Right! Generic struct 'StateObject' requires that 'ContentView.ViewModel' conform to 'ObservableObject' In line:
I tried to use Paul's code from https://github.com/twostraws/HackingWithSwift/tree/main/SwiftUI/project14 But it seems different from the one in tutorial. MAybe its a little older. |
|
I assume you mean the error is happening in ContentView and not in the EditView code you posted.
However in the iOS 17 way, you can simply use
and in your view code, simply do this:
|
|
Hi you are right. I posted EditView instead od ContentView...i'm sorry. I've already had I changed code like you suggested and now new error: Value of type 'Binding<ContentView.ViewModel>' has no dynamic member 'mapRegion' using key path from root type 'ContentView.ViewModel' |
|
Could you post your view and view model code for content view here so it'll be easier to debug? |
|
@swiftasroy I've tried many times but each time i got this message from this website: Your post was disallowed as spam. |
SPONSORED Superwall lets you build & test paywalls without shipping updates. Run experiments, offer sales, segment users, update locked features and more at the click of button. Best part? It's FREE for up to 250 conversions / mo and the Superwall team builds out 100% custom paywalls – free of charge.
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.