In this video, I show you how to implement tables in SwiftUI. Tables are a useful way to display and organize data, and they have been available in macOS for a while. With the introduction of iOS 16, we can now also use tables on the iPhone and iPad.
I start by explaining the basics of tables and how to add columns with headers. I also demonstrate how to expand and collapse columns and how to reorder and hide columns. Additionally, I show you how to select rows and add context menus to the table.
Next, I discuss how to customize the appearance of the table. I explain how to sort the data based on different criteria and how to use different types of data in the table. I also mention how to handle Boolean values and how to format dates in the table.
I then talk about how tables look on different devices. On the iPhone in compact mode, only the first column is shown, and on the iPad and Mac, all columns are displayed. I explain how to adjust the table for compact mode and how to use different views or cells for different screen sizes.
Finally, I cover some advanced features of tables, such as filtering the data based on a search text, modifying the table style, and disabling scrolling.
Overall, tables are a powerful tool 🤩
overview:
00:00 introduction
02:57 Basic implementation of SwiftUI Table
07:56 Static and dynamic data
09:59 Making Table selectable
11:35 Adding context menu
13:51 Sorting Table Data
19:48 Filtering data with searchable
21:59 Table appearance on iOS
26:00 Adjusting Table layout for compact mode
30:33 Customizing Table Appearance
32:33 Table updates for macOS 14
34:24 Wrap up
If you liked what you learned and you want to see more, check out one of my courses!
👨💻 my SwiftUI course https://school.swiftyplace.com/course...
👨💻 my Core Data and SwiftUI course https://school.swiftyplace.com/course...
#SwiftUITable #SwiftUILayout
Смотрите видео How to use SwiftUI Table on macOS and iOS онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Karin Prater 28 Июнь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,375 раз и оно понравилось 167 людям.