|
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. |
SAVE 50% All our books and bundles are half price for Black Friday, so you can take your Swift knowledge further without spending big! Get the Swift Power Pack to build your iOS career faster, get the Swift Platform Pack to builds apps for macOS, watchOS, and beyond, or get the Swift Plus Pack to learn advanced design patterns, testing skills, and more.
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.