Post

Replies

Boosts

Views

Activity

Reply to Football League calendar display view
I'm not near a Mac right now, but you're trying to iterate through the result that your giornataDisplay() function is returning, but it doesn't return anything. It looks like you're trying to create a View in that function without actually telling SwiftUI that this is a View. Move the stuff out of the function and into the ForEach loop, and see what happens. You might, alternatively, want to change that func into a struct that returns a View for the data passed into it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to SwiftData data propagation
The quiz results should be in the model data, and the destination view should be based off that data. When the model data is updated you can trigger the visibility of the destination view by changing the tab index of your toolbar to show that view.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to How to do Add, View, Edit (with Cancel and Done)
Let's say each Item has a unique id, a UUID. The way I've implemented this is to create a "blankItem" with default values and id = "". My Item edit screen takes an Item as a parameter, so, if I pass the blank item to the editor it will display those default values and let the user edit it. You can then set the buttons appropriately. I also set some lets that store the original values from the Item that was passed in, so I can disable the Done button if nothing has actually changed, and I can alert the user that they've made changes if they press Cancel. So, if the user tapped to create a new Item you're editing the blankItem. You assign an id once you validate the entered values are valid, and save the Item. You never save any changes to the blankItem; and you never save the blankItem to your data store. You simply use the blankItem as a way of populating the create screen with default values. If I'm editing an existing Item, then the screen is populated with the values from that Item, and I can check they've made changes or not with those lets think "original_name", "original_location" etc.). Because when you're editing an existing Item the id is not blank you can set the buttons here appropriately, too. And when you pass validation and save you update the actual Item based on its id. Hope this helps.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to User cannot sign in after the app is deleted and reinstalled
You don't actually explain where the user's details are stored? Are they on-device, or somewhere in the cloud? You need to figure out a way of allowing a user to login regardless of where they are in your app. If an app is deleted from a device, everything stored in that app's "sandbox" is deleted, too, so any information that a user is logged in should be deleted when the user deletes the app, so it looks like you're storing login data somewhere else? Can you provide us with some more concrete data on how your app is structured?
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’24
Reply to map issue- i keep having this warning is there any solution
It's just a deprecation message. You can either continue to use your existing code until Apple decides that the code is no longer supported (in which case your app won't build); or you can change it. I use something like this: @State private var mapPosition = MapCameraPosition.region(MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 51.507222, longitude: -0.1275), span: MKCoordinateSpan(latitudeDelta: 0.03, longitudeDelta: 0.03))) @State private var coordinates = CLLocationCoordinate2D(latitude: 51.507222, longitude: -0.1275) var body: some View { Map(position: $mapPosition) { Marker(mapMarkerName, coordinate: coordinates) } .mapStyle(.standard(elevation: .realistic)) .mapControls { MapCompass() MapScaleView() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’24
Reply to Question about Uploading my App to the Apple Store.
Go to App Store Connect, and under "Users and Access" you can add a user's name and email, and give them various rights. If you tick "App Manager", then click "See Permissions" you'll see what that role gives them. (Did you try any of this yourself?) You don't need to give them everything, and you don't need to give them your password. NEVER give away your password.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’24