what are the new scrollview apis on ios 18?
Generated on 7/31/2024
1 search
In iOS 18, there are several new ScrollView APIs introduced in both UIKit and SwiftUI. Here are the key updates:
SwiftUI
- Programmatic Control: You have more programmatic control over your ScrollView, including more scroll positions to programmatically scroll to, such as the top edge.
- Scroll Geometry Change: The
onScrollGeometryChange
modifier allows you to react to changes in content offsets, content size, and more. - Visibility Detection: You can detect when a view's visibility changes due to scrolling, enabling experiences centered around content moving on or off screen.
- Scroll Target Behavior: The
scrollTargetBehavior
can be set toviewAligned
to help make transitions more definite. - Content Alignment: You can control your content alignment and turn off bouncing along a given axis.
- Stopping Scrolling: There are options to programmatically stop scrolling.
For more details, you can refer to the session What’s new in SwiftUI (16:47).
UIKit
While the context does not provide specific new ScrollView APIs for UIKit in iOS 18, it mentions general improvements and new features in UIKit, which may include enhancements to existing components like ScrollView.
TVOS
- On Scroll Visibility Change: Similar to SwiftUI, TVOS 18 introduces the
onScrollVisibilityChange
modifier to react to visibility changes when content moves off screen. - View Modifiers: New view modifiers specific to ScrollView are introduced to enhance the scrolling experience.
For more details, you can refer to the session Migrate your TVML app to SwiftUI (10:07).
Sessions Mentioned
These updates provide developers with more tools and flexibility to create rich, interactive scrolling experiences in their apps.
Elevate your tab and sidebar experience in iPadOS
iPadOS 18 introduces a new navigation system that gives people the flexibility to choose between using a tab bar or sidebar. The newly redesigned tab bar provides more space for content and other functionality. Learn how to use SwiftUI and UIKit to enable customization features – like adding, removing and reordering tabs – to enable a more personal touch in your app.
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.
What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.
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.