Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create multi-column table in SwiftUI using Table framework - iOS 16 beta

I'm trying to follow Apple's Table tutorial to create a multi-column table.

Using the exact code from the tutorial in Xcode 14 beta 3 (iOS 16 beta) gives me the following result:

enter image description here

where the expected result based on the tutorial is

enter image description here

As you see, I can only see one column without header. Does anyone know what I'm missing here?

like image 349
Mina Avatar asked Mar 09 '26 04:03

Mina


1 Answers

On iOS, tables show only the first column. To show it as a multi-column, implement compact-specific logic. Source: https://developer.apple.com/documentation/SwiftUI/Table

Using tables on different platforms macOS and iPadOS support SwiftUI tables. On iOS, and in other situations with a compact horizontal size class, tables don’t show headers and collapse all columns after the first. If you present a table on iOS, you can customize the table’s appearance by implementing compact-specific logic in the first column.

like image 138
acorscadden Avatar answered Mar 10 '26 18:03

acorscadden



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!