wouter125 / bottomsheet Goto Github PK
View Code? Open in Web Editor NEWAn iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.
License: MIT License
An iOS library for SwiftUI to create draggable sheet experiences similar to iOS applications like Maps and Stocks.
License: MIT License
Xcode version: 15.0.1
BottomSheet version: 2.0.1
I added an import for BottomSheet in a SwiftUI View file. When I call BottomSheetView just like an example in the README.md:
BottomSheetView(
position: $position,
animationCurve: SheetAnimation(
mass: 1,
stiffness: 250,
damping: 25
),
background: (
Color(UIColor.secondarySystemBackground)
),
header: { },
content: {
EmptyView()
.onSheetDrag(translation: $settings.translation)
}
}
I get an compiler error: Cannot find 'BottomSheetView' in scope
Probably a silly question but is there a way to give the top of the drawer a corner radius?
Hey. Thanx for such awesome lib)
To reproduce:
In sample app drag sheet to top position, the drag content even higher. Then drag header to any other position without touching content. After that try to drag content.
swift-package-list and other automatic license generation tool expect a LICENSE file being present in order to introduce it in the generated settings bundle. As such a License file is required in the repo.
I have created a PR for it:
#34
Hi, I'm playing around with the new version and it's quite nice !
I'm currently having 2 issues :
• first I think the Spacer() at the top of SheetPlus.body is useless and It actually cause an issue when using full height and trying to touch the NavigationBar with the sheet. Removing it fixed the issue. If it's intended to be there maybe this should be configurable ?
• second I couldn't find the correct way to add a NavigationView as the body of the sheet. If I add a NavigationView it break some constraints. I figured I could set ideal frame to the NavigationView and it shows but then the scrolling behaviour is no longer working inside the scrolling content. Depending if I add a scrollview to the content inside the NavigationView, I either have the navbar working or the scroll.
I'm not sure how to fix the second issue, iterating child views to find a scrollview and adding your scroll behaviour and if no scrollview if found adding one like you do might work but it might be hard to be sure to stop on the right scrollview. I believe the Apple version use something like that but don't look too deep in the childviews.
I'll make a fork to display the issue.
Hi, what is the license for this library?
One of the major issue on how to attach the sheet on a navigationView stack is still not resolved.
Originally posted by @nitishshreee in #19 (comment)
hi how i can find BottomSheetView i imported BottomSheet but there is no module of BottomSheetView
I am using relative positioning inside a NavigationView. The issue about the wrong position and enter animation makes this library unusable. If there is no NavigationView, there is no issue. But I do need it.
enum BottomSheetPosition: CGFloat, CaseIterable {
case top = 0.83
case middle = 0.385
}
@State var bottomSheetPosition: BottomSheetPosition = .middle
BottomSheetView(
position: $bottomSheetPosition,
header: {
},
content: {
ForecastView(bottomSheetTranslationProrated: bottomSheetTranslationProrated)
}
)
.onBottomSheetDrag { translation in
bottomSheetTranslation = translation
withAnimation(.easeInOut) {
if bottomSheetPosition == BottomSheetPosition.top {
hasDragged = true
} else {
hasDragged = false
}
}
}
`
VStack(spacing: 0) {
ScrollView {
ForEach(0..<5, id: .self) { _ in
newsRow
}
}
Spacer(minLength: 54)
}
`
I will try to keep a list of fixes that need to be applied here. Feel free to open a PR if you got a fix for some of them;
Minor
Major
Released
.offset(y: UIScreen.main.bounds.height - translation)
)I think that adding in a feature where you can dismiss the view by clicking the background would be beneficial.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.