Post

Replies

Boosts

Views

Activity

Comment on How come I get "Cannot convert value of type 'Font.TextStyle' to expected argument type 'Font?'" when trying to apply a TextStyle from a Binding with `.font()`?
.font() does accept Font.TextStyle (https://developer.apple.com/documentation/swiftui/font/textstyle). I specify Font.TextStyle, because I have a Picker in the parent view that'll determine selectedSystemFont, and it does not register state change from the ForEach without it. Picker( selection: $selectedSystemStyle) { ForEach(Font.TextStyle.allCases, id: \.self) { appleTextStyle in Text(appleTextStyle.rawValue).tag(appleTextStyle) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’24