Post

Replies

Boosts

Views

Activity

Reply to Different symbols for different iOS-Versions.
Here's one way of doing it: struct ContentView: View { var body: some View { if #available(iOS 17, *) { // If iOS 17 or greater is in use, these symbols will be used let kSymbolMedikamente: String = "syringe" let kSymbolBPR: String = "point.bottomleft.forward.to.arrowtriangle.uturn.scurvepath" let kSymbolInvasiveMassnahmen: String = "heart.text.square" } else { // Anything lower than iOS 17 will use these symbols let kSymbolMedikamente: String = "syringe" let kSymbolBPR: String = "point.bottomleft.forward.to.arrowtriangle.uturn.scurvepath" let kSymbolInvasiveMassnahmen: String = "heart.text.square" } TabView { Group { Medikamente() .tabItem { Image(systemName: kSymbolMedikamente) Text("Medikamente") } BPR() .tabItem { Image(systemName: kSymbolBPR) Text("BPR") } InvasiveMassnahmen() .tabItem { Image(systemName: kSymbolInvasiveMassnahmen) Text("Maßnahmen") } } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’23
Reply to Help with Xcode 15 Watch Complication
Where are your Watch complications stored? Are they in a WidgetKit Extension target? When you added the Watch App target to your main iOS app, did you then add a new WidgetKit Extension (watchOS) and select to embed it inside the Watch app? That's what you need to do. If you don't have the complications as a separate extension target, you can easily add a new one and move the code over. I had issues with Xcode always creating iOS extensions rather than watchOS ones, but a reinstall of Xcode fixed it.
Topic: App & System Services SubTopic: General Tags:
Oct ’23
Reply to simulator not opening or booting after wasting a lot of money on data (no retry option )
How were you downloading Xcode? If you download it through Safari you can simply press the orange retry button in the downloads window and it picks up where it left off. In my experience the Simulators have always downloaded fine. Seeing as you had to download them a few times to get a full version, why didn't you go to a cafe or somewhere else with free Wi-Fi? You don't explain how the simulator you downloaded isn't "functioning properly" so no one can help you there. Your post isn't really about developing for Apple's operating systems; it's more of a moan that you had to spend time setting things up.
Oct ’23
Reply to Extra trailing closure passed in call
Since you say this is a new view inside an existing project, if you comment out that new code, do you still get the error? I'm just trying to figure out whether it's in this code or some other code, as I've just added your simple code into my project and there are no issues.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’23
Reply to I'm confused about WatchKit and WidgetKit and Watch Apps... Help!
Hi @radox1, no I didn't manage to migrate them in the way you suggest. Xcode never offered me that option. Here's how I've done it: Make sure your Home Screen and Lock Screen Widgets are in one iOS WidgetKit Extension target. Add a new watchOS WidgetKit Extension target and ensure you embed it in your Watch App. Put your complications in this new target. You can add code that's shared between targets into a folder at your project's root level, i.e. not within a specific target, and mark those files as available to the appropriate targets. For example, I have a shared functions Swift file that my Complications, Widgets and Watch App can use, and I put my localised strings into that folder, too. Use ConfigurationAppIntents to configure dynamic widgets and complications. The old way of using SiriKit is an annoying nightmare that Apple should never have forced onto us.
Topic: App & System Services SubTopic: General Tags:
Oct ’23