mtj0928 / resizablesheet Goto Github PK
View Code? Open in Web Editor NEWHalf modal view for SwiftUI
License: MIT License
Half modal view for SwiftUI
License: MIT License
Thank you for open source. I think ResizableSheet is a more SwiftUI way implementation.
But when I add Multi-line Text in builder.content
, the scrollView's content size is incorrect.
It seems the sheet always needs medium then close. How to Large -> hidden?
Hola. Thanks for provide the community with such an elegant sheet. No major issues, just something I've noticed.
The sheet's background changes when the system's theme changes: dark mode gives the sheet a dark color and light mode... white sheet. Apps can specify a theme in which the sheet does not respect. An example how an app could change the theme:
class Utilities: ObservableObject {
// The default is to use the system's default.
@AppStorage("theme") var theme: String = ""
var userInterfaceStyle: ColorScheme? = .dark
func overrideDisplayMode() {
var userInterfaceStyle: UIUserInterfaceStyle
if theme == "On" {
userInterfaceStyle = .dark
} else if theme == "Off" {
userInterfaceStyle = .light
} else {
userInterfaceStyle = .unspecified
}
let scenes = UIApplication.shared.connectedScenes
let windowScene = scenes.first as? UIWindowScene
let window = windowScene?.windows.first
window?.overrideUserInterfaceStyle = userInterfaceStyle
}
}
Should the system is set to dark mode and the app to light, the content sheet's background is still dark. Ok I could use the .sheetBackground
modifier you've provided us, with a combination with @Environment(\.colorScheme) var colorScheme
. Seems a bit messy if we have many sheets within the app. Is there a way to make the sheet respect the app's theme? I'd rather not having to keep repeating this:
view.resizableSheet($state) { builder in
builder.content { context in
VStack {
Text("Demo")
Spacer()
}
.padding()
.frame(height: 300)
}.sheetBackground { _ in
Color(colorScheme == .light ? "custom-white" : "custom-secondary")
}
}
Unfortunately I couldn't even present a simple Text("text") based on your documents in a timely manner.
Simple example project would've been very helpful
I will introduce SwiftLint
I will introduce GitHub Actions after #7.
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.