Post

Replies

Boosts

Views

Activity

Reply to XCode + SwiftUI+ EnvironmentObject not working on iPad
Hi, It looks like you are passing the return Value from the GetValue() function into the Text Element. Try this:  Text(sharedObj.CustomString)         Button(action: {             sharedObj.Update(input: "NewValue")         }){             Text("Update")         } When you call the update function the Custom String is automatically updated in the Text Element. Take care, David
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to SwiftUI MapKit Callouts
Hi, sadly the SwiftUI MapKit implementation is very poor at the moment. You can wrap the EventMapAnnotation in a Button(action: {}), this at least gives you the option of calling a function that will then trigger some action. Take care, David
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to SwiftUI Navigation link issue
Hi, I would put the ForEach in either a List, or a form. Then you should change the row to something like this:   NavigationLink(destination: Text("Destination")){         VStack{             Text("Content")         }     } The NavigationLink should be the first thing in the row to work probably. Take care, David
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to How to create Tappable Button in swiftui For Widgets
Hi, Widgets will always launch the app when they are tapped, so there is no way to only add an action to the widget. Depending on the Widget Size you have the option of using Tap targets. The small Widget only has one big button, itself. The large Widget has a few targets that can perform different actions by using different URLs, but they also launch the app. Take care, David
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’21
Reply to User configurable WidgetKit backgrounds ?
Hi, yeah the thing with the battery widget and the forbidden background blur... Well at least for the configurable colors there is a solution. I have seen a few apps implement this feature. The easiest way I think is to use the widget configuration to give the user a list of options, and then storing the picked color. You could then get the color when building the widget, maybe UserDefaults or something like that, and set the background accordingly. The user could use the main app to edit and add colors to their list which is then displayed in the configuration... Even though it is a hacky solution it should work. Take care, David
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21