Post

Replies

Boosts

Views

Activity

Text is truncated with certain font sizes on iOS 17+, but not on iOS 16
’m experiencing an issue where a Text view is unexpectedly truncated with certain font sizes (e.g., .body) on iOS 17 and later. This does not occur on iOS 16. I’ve applied .fixedSize(horizontal: false, vertical: true) to allow the text to grow vertically, but it still doesn’t show the entire content. Depending on the text content or font size, it sometimes works, but not always. How can I ensure the full text is displayed correctly on iOS 17+? Here is a minimal reproducible SwiftUI example: let sampleText1 = """ これはサンプルのテキストです、 ・箇条書き1 ・箇条書き2 であかさたなクロを送り、 アアを『ああああいいいい』フライパンに入れ、あかさたなです😋 """ let sampleText2 = """ 【旬|最高級】北海道産 生サンマ 釜飯 ----- Aaa iii uuu """ struct ContentView: View { var body: some View { ScrollView { VStack(alignment: .leading, spacing: 10) { HStack { MessageTextView(text: sampleText1) .layoutPriority(100) Spacer() } HStack { MessageTextView(text: sampleText2) .layoutPriority(100) Spacer() } } } } } struct MessageTextView: View { var text: String var body: some View { Text(text) .fixedSize(horizontal: false, vertical: true) .font(.body) .padding(.leading, 16) .padding(.trailing, 16) .padding(.top, 8) .padding(.bottom, 8) } } img1 img2
4
0
113
Apr ’25
Button Touch Not Canceled in ScrollView on Modal in SwiftUI for iOS 18
When displaying a view with a Button inside a ScrollView using the sheet modifier, if you try to close the sheet by swiping and your finger is touching the Button, the touch is not canceled. This issue occurs when building with Xcode 16 but does not occur when building with Xcode 15. Here is screen cast. https://drive.google.com/file/d/1GaOjggWxvjDY38My4JEl-URyik928iBT/view?usp=sharing Code struct ContentView: View { @State var isModalPresented: Bool = false var body: some View { ScrollView { Button { debugPrint("Hello") isModalPresented.toggle() } label: { Text("Hello") .frame(height: 44) } Button { debugPrint("World") } label: { Text("World") .frame(height: 44) } Text("Hoge") .frame(height: 44) .contentShape(Rectangle()) .onTapGesture { debugPrint("Hoge") } } .sheet(isPresented: $isModalPresented) { ContentView() } } }
12
17
2.1k
Sep ’24