Xcode – Take Screenshot in SwiftUI Preview
I have some nice dummy data built out for my previews and don't want to have to replicate it on the simulator or my personal device (where I use the app myself with my own data)... How can I screenshot…
I have some nice dummy data built out for my previews and don't want to have to replicate it on the simulator or my personal device (where I use the app myself with my own data)... How can I screenshot…
I have view that I'd like to show as a fullScreenCover, I noticed one little issue after presenting it that it does not resize the font when the dynamic type changes. Is there a nice way of fixing this? Here's…
I've been trying different ways of drawing a line between 2 circles(first and second circle) in SwiftUI. My view is basically a grid of 50 circles in a 10 x 5 grid. Have found some other threads on using preference…
I have this Text in SwiftUI : Text("Level (level.id)" + (level.isEnded ? " ended" : "")) This string does not automatically go to the Strings catalog. What is the best way to deal with this kind of text and localization…
Here is the piece of code, half is commented, in the first part, text elements from array are in VStack, and each one appears in new line. but on clicking it gives details about the clicked array element. But in…
I have created a horizontal carousel using a ScrollView with an HStack. This is my code: struct CarouselView<Content: View>: View { let content: Content private let spacing: CGFloat private let shouldSnap: Bool init(spacing: CGFloat = .zero, shouldSnap: Bool = false,…
With the new modifier scrollTargetBehavior(.paging), ScrollViews now get paging behavior. It works great but I've yet to find a way to get the currently displayed view. I've tried using the onAppear on each view, but it doesn't correlate to when…
I have a horizontal scroll user experience with a ScrollView and an HStack. I wanted to figure out a way to realize that the user has reached the end of the HStack. To accomplish that, I used this solution (open…
I have a list with items which are pulled from a firebase database. I would like individual counters for each item but one variable isn't doing this for me and is adding 1 to each item on the list. Picture…
After iOS 17 / Xcode 15 the previews for my widgets are inset and squeezed into the view. I added a .contentMarginsDisabled() modifier to the intent, which fixes this in the actual widgets on a device, but the previews still…