presentationCompactAdaptation(_:) modifier. In iOS 16.4, we can control this behavior using the new. In horizontally or vertically compact size classes, a modal presentation like a sheet or popover might change its appearance. Control a modal presentation in compact-size classes You can only scroll after the presentation reaches its largest detent size. struct ContentView : View private var isPresented = false presentationContentInteraction(.scrolls) to make scrolling take precedence over the sheet resizing. So you can only scroll after the presentation reaches its largest detent size. We set the corner radius of the sheet to 60 in this example.presentationCornerRadius(60) Control scrolling and expansion behaviorīy default, a sheet resizing take precedence over a scroll view embedded in the sheet. We can finally change the corner radius of a sheet using. I think many people would love this new API. presentationBackground(.ultraThinMaterial) Adjust the corner radius of a sheet The following example uses the ultra-thin material ( ultraThinMaterial) as the sheet background. We can make a sheet background translucent with the new presentationBackground(_:) modifier. Sponsor and reach thousands of iOS developers. You can easily support by checking out this sponsor. Īs you can see, we can click on the image at the back and get " Image tapped" print in the debug console.presentationBackgroundInteraction(.enabled) presentationBackgroundInteraction(.enabled) make the view behind the sheet still accept user interaction. ![]() presentationBackgroundInteraction(.enabled) modifier. presentationDetents to show a non-full-size sheet.īut we can't interact with a view behind the sheet. Control a modal presentation in compact size classes.Control scrolling and expansion behavior.I will group the changes into three categories.Īpple introduces a new set of view modifiers that works on modal presentation, e.g., sheet or popover. In this article, we will quickly go through some of them that I find interesting. Apple released Xcode 14.3 Beta and iOS 16.4 this morning (February 16, 2023), and it came with a lot of improvement, more than I expected.
0 Comments
Leave a Reply. |