Перейти к содержимому

BottomSheets and PresentationDetents in SwiftUI

Stewart Lynch

0:00 / 0:00

BottomSheets and PresentationDetents in SwiftUI

6 363 просмотра · 4 года назад
Stewart Lynch
27 тыс. подписчиков
6 363 просмотра · 4 года назад
In this video, I am going to introduce you to the new bottom sheet presentationDetents modifier that was introduced in iOS 16. This will gives us the ability to control the height of our modal sheets. I will introduce you to detents and all of their options and create a custom view modifier to optionally add a close button to any one of your sheets. We will look at different sheet view presentation overloads and finally, how you can create your own custom detent. If you want to support my work, you can buy me a coffee :) https://ko-fi.com/stewartlynch Table of Contents: 0:00 Introduction 1:50 The Basics 6:51 Custom ViewModifier 11:35 Fraction and Height Detents 13:20 Multi Sheet presentations 16:59 Custom Detents Starter Project Files: http://www.createchsol.com/StarterPro... Completed Project: https://github.com/StewartLynch/Botto... References mentioned in video: Custom View Modifiers    • Custom View Modifiers in SwiftUI   Enums and Multiple Modal Sheets    • Two SwiftUI Enum Use Cases   Natalia Panfernova - NilCoalescing Blog https://nilcoalescing.com Other References: Stewart Lynch's YouTube Channel:    / stewartlynch   Stewart Lynch on Twitter:   / stewartlynch