How to make UICollectionView with table like layout?
Generated on 9/6/2024
1 search
To create a UICollectionView
with a table-like layout, you can use the new list environment trait in UIKit. This trait allows you to style cells appropriately based on the list's style, such as regular cells, headers, or footers. You can utilize UIListContentConfiguration
and UIBackgroundConfiguration
to adjust properties according to the list environment, which simplifies the process of configuring cells without needing to know the list style in advance.
For example, in the Files app, a UICollectionView
with a compositional layout is used to display a list of locations, favorites, and tags in different styles depending on the context. In portrait mode, it uses an inset grouped appearance, while in landscape mode, it uses a sidebar appearance. This is achieved by generating content and background configurations based on the list appearance.
For more details, you can refer to the session What’s new in UIKit (07:54) where list improvements are discussed.
Get started with Dynamic Type
Dynamic Type lets people choose their preferred text size across the system and all of their apps. To help you get started supporting Dynamic Type, we’ll cover the fundamentals: How it works, how to find issues with scaling text in your app, and how to take practical steps using SwiftUI and UIKit to create a great Dynamic Type experience. We’ll also show how you can best use the Large Content Viewer to make navigation controls accessible to everyone.
What’s new in UIKit
Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.
Migrate your TVML app to SwiftUI
SwiftUI helps you build great apps on all Apple platforms and is the preferred toolkit for bringing your content into the living room with tvOS 18. Learn how to use SwiftUI to create familiar layouts and controls from TVMLKit, and get tips and best practices.
Demystify SwiftUI containers
Learn about the capabilities of SwiftUI container views and build a mental model for how subviews are managed by their containers. Leverage new APIs to build your own custom containers, create modifiers to customize container content, and give your containers that extra polish that helps your apps stand out.