0

How can I get Table content size?

GeometryReader { proxy in
                    Table(self.viewModel.session.records, sortOrder: self.$order) {
                        TableColumn("Id", value: \.id)
                        TableColumn("Name", value: \.name)
                        
                        TableColumn("Category ID", value: \.cId)
                    }
                    .onAppear {
                        self.tableSize = proxy.size
                    }
                }

from following code I get always zero

Sargis
  • 33
  • 8
  • You should use a PreferenceKey if you're trying to transmit the size back to the parent. See https://www.fivestars.blog/articles/swiftui-share-layout-information/ – jnpdx Jul 02 '23 at 03:34

0 Answers0