Why does the colon display lower than all of the other characters in Text ending in colon in SwiftUI?
I recently started using SwiftUI. Today, I’ve come across the oddest phenomenon. When I display simple Text ending in a colon, that colon at the end displays lower than all of the other characters, including any other colons in the text. Is this normal, expected behavior in SwiftUI? Is there any way to prohibit this from happening?
How to navigate through a questionnaire?
currently I’m struggeling in tinding a solution. I have a main view which loops over CoreData records for questionnaires and displays them in a list within a NavigationStack
. Then I have a view that displays a single question of a questionnaire. How would I now handle the navigation through my questions in a choosen questionnaire because my subview is only accepting a single question and I need somewhere to keep track on the status of the current questionnaire.
SwiftUI 3rd level of .sheet() disappears immediately
In MacCatalyst on MacOS Sonoma 14.6 when my app has 3 levels of active sheets the 3rd sheet disappears immediately after presenting, if the 1st level sheet is a modifier on a view in the NavigationStack, rather than a modifier of the NavigationStack. I don’t have this problem in MacCatalyst on MacOS 13.6, on iOS 16.4 or on iOS 17.6. In my real app each one of these NavigationStacks has many sheets, hence the use of the overlays. What’s the right way to make this work on iOS > 16 and macCatalyst on MacOs > 14.6? Thank you
SwiftUI Toggle stops responding after returning from background
Having a weird bug. I am running a beta of ios18.1 btw.. so maybe that’s the issue. I have a few toggle controls on a .medium height share sheet. They work well. If I background the app, and then foreground, one of the toggles stops responding (the bottoms most one in the vstack). Well.. if I tap several times sometimes it works, but certainly not well. Has anyone encountered this?
Why is `onAppear` called for all elements in a `LazyVStack` or `LazyHStack` if it’s not inside a `ScrollView`
I want to create a LazyHStack
without a ScrollView
so I can use my own gestures etc.
Setting button text from variable causes “Cannot convert value of type ‘String’ to expected argument type ‘LocalizedStringKey'”
This is a simple question, but I can’t figure it out.
SwiftUI Publishing changes from background threads is not allowed
@MainActor class MortgageCalculatorViewModel: ObservableObject { // MARK: – Published Properties (Your Data Model) @Published public var homeValue: Double = 500_000 // Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates. @Published public var downPaymentPercentage: Double = 3.5 / 100 @Published […]
Use the SF Rounded font for all text by default in SwiftUI
I keep manually specifying design: .rounded
:
Styling NavigationLink like a button
I have the following code to style a NavigationLink:
SwiftUI’s `refreshable` closure captures `self` only once
It appears that refreshable closure captures copy of self
dead tight on first View
initialization and never recreates itself on body
invocations.