swiftui drawer
Landscape
맵 앱에서와 같이 Swiftui 상향식 컨트롤러. 드래그하여 확장하거나 최소화합니다.
파일> 스위프트 패키지> 패키지 추가 종속성 추가 : https://github.com/maustinstar/swiftui-drawer
Package.swift 에 종속성을 추가하십시오
. package ( url : " https://github.com/maustinstar/swiftui-drawer.git " , from : " 0.1.0 " ) , 서랍을 마지막 요소로 ZStack 에 뷰를 포함시킵니다. heights 매개 변수는 서랍의 휴식 높이 목록을 정의합니다.
ZStack {
ScrollView {
//...
}
Drawer ( heights : [ 100 , 340 ] ) {
Color . blue
} . edgesIgnoringSafeArea ( . vertical )
}전체 참조 안내서를 참조하십시오.
햅틱 충격이있는 다중 높이 서랍.
Drawer {
ZStack {
RoundedRectangle ( cornerRadius : 12 )
. foregroundColor ( . white )
. shadow ( radius : 100 )
VStack ( alignment : . center ) {
Spacer ( ) . frame ( height : 4.0 )
RoundedRectangle ( cornerRadius : 3.0 )
. foregroundColor ( . gray )
. frame ( width : 30.0 , height : 6.0 )
Spacer ( )
}
}
} . edgesIgnoringSafeArea ( . vertical )
. rest ( at : . constant ( [ 100 , 340 , UIScreen . main . bounds . height - 40 ] ) )
. impact ( . light )더 많은 예를보십시오
이 패키지로 Swiftui 앱을 다음 단계로 끌어 올리십시오!