SwiftUI: Custom Rounded Shapes Like in watchOS 11 Workout Scale
I’m looking to create a new screen in my SwiftUI app that features a “workload rating scale” similar to that of the new training load in watchOS 11 and iOS 18 (https://www.apple.com/watchos/watchos-preview/). It looks super neat and is really intuitive for the user. However, I’m having a lot of trouble creating the custom shapes in code. Trapezoids are being weird, I can’t make rectangles with a rounded triangle on top, and I’m running out of patience, haha….
SwiftUI How can I modify an object from an array and update the corresponding sub view automatically?
import SwiftUI // MARK: This is just a very simple model struct Person: Identifiable { var id: Int var name: String init(id: Int, name: String) { self.id = id self.name = name } } // MARK: This is a view model,where I can load data from server or modify an object class Model: ObservableObject{ @Published […]
XCode SwiftUI App Preview not showing up (previews on other views work)
I feel like the answer might be obvious but I’m having a hard time.
How to solve a “GoogleAppMeasurementOnDeviceConversion” Error
I have an Error that says “GoogleAppMeasurementOnDeviceConversion”, these are the details of my error in xcode:
App Freezes when Swiping Left on Menu Component
When I swipe left, the view freezes but the menu component still works when swiping. Also, when it’s frozen, if I just click anywhere in the frozen area, it toggles the menu, and then when I close the menu it’s unfrozen and works again. What might be the problem?
Xcode Beta strange animation / transition between my navigation
Since I downloaded the Xcode beta version, a strange process has occurred with the views with my navigation. I couldn’t find anything online about this, I’ve also searched for transitions and animations in my code, but unfortunately I couldn’t find anything.
macOS app crashes in Xcode and then doesn’t run anymore, but there are no error messages
I am fairly new to development in Xcode and I’m a bit at a loss. I’ve been working for some time on a macOS app in Xcode 15.4 using SwiftUI and Core Data. Yesterday I made a tiny change to the code that is in no way critical and also used in other places in the app. I launched the app from Xcode like hundreds of times before and when the added line of code was triggered, the app and Xcode crashed with the candy wheel of death without error message. I deleted the line I most recently added but somehow something has changed now. When I run the app, the app icon is shown in the dock, but that’s it – no windows appear, the menu does not appear, the console shows no warnings (as it did before), but there is also no error message. I cleaned the cache, cleaned the build folder, restarted Xcode, restarted the Mac, but the app is dead. When I switch to an older version, at some point it will run this older version. So do I now have to manually implement all the changes again to get the app to the same level as it was before it crashed and hope this won’t happen again? Does anyone know what could cause this behavior in Xcode or how to fix it? Thank you!
How to mock #Preview with a view expecting an Error as parameter?
I have a view showing error information which is working fine. The information is wrapped inside a struct. But I couldn’t figure out how to mock the expected data to show the view in preview canvas.
Save Scroll Position SwiftUI
I’m currently using the posts to save the scroll position, but is there was way to save the exact scroll position so it stops jumping around and saves precisely.