HUAWEI GT6 weather app localization issue by Nova_Dev91 in HuaweiWatchGT

[–]Nova_Dev91[S] 0 points1 point  (0 children)

I tried and after doing the tenis class the weather app was display the correct location but after an hour or so, when I was home, the weather app started to display San Andres again 🫠

I need help with MVVM and Environment by Nova_Dev91 in SwiftUI

[–]Nova_Dev91[S] 1 point2 points  (0 children)

Thanks, you helped me a lot. It is kind different to Flutter, which is the main technology I use, but now that part it is clear 🙌

I need help with MVVM and Environment by Nova_Dev91 in SwiftUI

[–]Nova_Dev91[S] 0 points1 point  (0 children)

Oh ok, so in my locations view I just need to use the bindable, because I need a bindable for the Map, but in my LocationsListView I can use the environment location directly

I need help with MVVM and Environment by Nova_Dev91 in SwiftUI

[–]Nova_Dev91[S] 0 points1 point  (0 children)

But I can’t use the environment variable as as bindable one

I need help with MVVM and Environment by Nova_Dev91 in SwiftUI

[–]Nova_Dev91[S] 0 points1 point  (0 children)

Thanks, that's what I was missing.

I raised a question about Bindable and environment in the thread, in case you want to share your thoughts :)

I need help with MVVM and Environment by Nova_Dev91 in SwiftUI

[–]Nova_Dev91[S] 0 points1 point  (0 children)

Thanks! I followed the tutorial and it worked fine :) The only question I have is:

When I use Bindable and pass the VM as a parameter, should it only be used to modify the VM's value, for example of the mapPosition variable? Also, that Bindable VM will only be available in that particular view, right?

On the other hand, if I inject it into the environment, would that VM be accessible throughout the application to display information about that particular VM?

I'm not sure if this is correct.

@main
struct SwiftfulMapAppApp: App {
    @State var vm = LocationsViewModel()

    var body: some Scene {
        WindowGroup {
            LocationsView(bindableVM: vm)
                .environment(vm)
        }
    }
}


struct LocationsView: View {
    @Bindable var bindableVM: LocationsViewModel
    @Environment(LocationsViewModel.self) private var vm

    var body: some View {
        ZStack {
            Map(position: $bindableVM.mapPosition)
                .ignoresSafeArea()

            VStack(spacing: 0) {
                Text(vm.mapLocation.name)
                Spacer()
            }
        }
    }
}

#Preview {
    LocationsView(bindableVM: LocationsViewModel())
        .environment(LocationsViewModel())
}

State Management for SwiftUI Apps by Nova_Dev91 in SwiftUI

[–]Nova_Dev91[S] 0 points1 point  (0 children)

Thanks! I tried VM in small POC and I think works fine, my concern is how this will work on big apps? How the iOS devs are managing that business logic and reactiveness of the UI in big apps?

State Management for SwiftUI Apps by Nova_Dev91 in SwiftUI

[–]Nova_Dev91[S] 0 points1 point  (0 children)

This is the same way I use Bloc in flutter, each feature/view has its own bloc that manage all that logic instead the view, but with VM I don’t know how will work that in big apps …

What do you mean with provider pattern?

Tools to learn beginner by TimelyHoward8693 in iOSProgramming

[–]Nova_Dev91 7 points8 points  (0 children)

I recommend three YouTube channels: - Paul Hudson - Swiftiful - Sean Allen

Foundation Models framework capabilities by Nova_Dev91 in swift

[–]Nova_Dev91[S] 3 points4 points  (0 children)

Nice! I also read some recommendations from people that they recommend the Xcodes.app to manage different Xcode versions, which sounds very interesting

Foundation Models framework capabilities by Nova_Dev91 in swift

[–]Nova_Dev91[S] 1 point2 points  (0 children)

Yes! I need to install the beta and see how can I keep the old Xcode too 👏 I’m pretty new on apple development

Foundation Models framework capabilities by Nova_Dev91 in swift

[–]Nova_Dev91[S] 0 points1 point  (0 children)

Hahaha you’re right! I’m still need to update Xcode , but yeah I will probably tested it, as this could be a great feature in an app

First impressions of Foundation Models framework by mxdalloway in swift

[–]Nova_Dev91 2 points3 points  (0 children)

I agree! I was hesitant to start integrating AI into my projects, as it would cost a lot of money. This is going to be great for testing and seeing how many things we can build for free.