Giter Club home page Giter Club logo

resizablesheet's People

Contributors

mtj0928 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

resizablesheet's Issues

Bugs on Muti-line Text View

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.

Sheet background does not respect app's theme

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")
            }
        }

Add example project

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.