iOS/SwiftUI

[iOS / SwiftUI] Bottom Sheet Drawer Use with Gesture

TDCIAN 2022. 1. 7. 17:13

Hi! this is TDCIAN!

 

Let's find out about how to make bottom sheet drawer that move with gesture!

 

Look at these codes!

 

(1) Home.swift

 

 

 

(2) BlurView.swift

 

 

 

(3) CustomCorner.swift

 

 

 

(4) ContentView.swift

 

 

 

(5) In simulator

 

When you launched app, In Home.swift, find code in 97th line.

 

When you pushed sheet up lower than half -> In Home.swift, 'offset = -(maxHeight / 4)', find code in 86th line.

 

When you pushed sheet up more than half -> In Home.swift, find code in 93th line.

 

 

Full source code: https://github.com/TDCIAN/SwiftUIBottomSheetDrawer

 

GitHub - TDCIAN/SwiftUIBottomSheetDrawer: based on: https://www.youtube.com/watch?v=CyMtjSspJZA

based on: https://www.youtube.com/watch?v=CyMtjSspJZA - GitHub - TDCIAN/SwiftUIBottomSheetDrawer: based on: https://www.youtube.com/watch?v=CyMtjSspJZA

github.com

 

Reference: https://www.youtube.com/watch?v=CyMtjSspJZA 

 

Images Reference: https://unsplash.com/

 

Beautiful Free Images & Pictures | Unsplash

Beautiful, free images and photos that you can download and use for any project. Better than any royalty free or stock photos.

unsplash.com