Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Dark Color #101

Open
cvonlehe opened this issue Jul 22, 2016 · 2 comments
Open

Switch to Dark Color #101

cvonlehe opened this issue Jul 22, 2016 · 2 comments

Comments

@cvonlehe
Copy link

How do you switch to the dark color? Is there a simple boolean you have to set? I've been looking for a way to do it and can't seem to find it.

@cyrilzakka
Copy link

Nope, from my understanding of the code, the switch to dark color happens automatically (i.e. sent by the container app). It's up to the developer to color the keyboard accordingly.

@ifanchu
Copy link

ifanchu commented Jan 28, 2018

I also have this question. There must be a way to specifically saying to use darkmode (darkmode looks pretty good).

The lines of code I was looking at was KeyboardViewController

func darkMode() -> Bool {
    let darkMode = { () -> Bool in
        let proxy = self.textDocumentProxy
        return proxy.keyboardAppearance == UIKeyboardAppearance.dark
    }()
    
    return darkMode
}

Simply return true here.

And KeyboardInputTraits.swift

    if let layout = self.layout {
        let appearanceIsDark = (proxy.keyboardAppearance == UIKeyboardAppearance.dark)
        if appearanceIsDark != layout.darkMode {
            self.updateAppearances(appearanceIsDark)
        }
    }

However, I tried several things and the keyboard color did change to not to exactly darkmode.
Please give some advice. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants