isaced / ISEmojiView

Emoji Keyboard for iOS
MIT License
522 stars 119 forks source link

Support Dark Keyboard on iOS 13 when Dark Mode is enabled #58

Closed thejeff77 closed 4 years ago

thejeff77 commented 4 years ago

Keyboard has white background on iOS 13 when in dark mode.

For reference, if this helps speed up implementation:

        if #available(iOS 13, *) {
            if (vc.traitCollection.userInterfaceStyle == .dark) {
                // Make keyboard background dark.
            }
        }
thejeff77 commented 4 years ago

Looks like this is on line 217 of EmojiView.swift

I think something like this will do it:

private func setupView() {
    if #available(iOS 13, *) {
        backgroundColor = UIColor.secondarySystemBackground
    }
    else {
        backgroundColor = UIColor(red: 249/255.0, green: 249/255.0, blue: 249/255.0, alpha: 1)
    }
}

Will also have to check the other view classes for equivalent stuffs.

isaced commented 4 years ago

Thanks for the ideas @thejeff77 , I pushed some code to the master branch and updated the example, it looks good, please try it.

image

thejeff77 commented 4 years ago

Wow cool screenshots. Thanks for doing this! You're like 12 hours ahead of me, was gonna do this today. I'll try it out right now. Thanks :)

Tried to add Swift Package Manager to this project but ran into issues. Any help with that would be pretty great.

I'll report back in a few.

thejeff77 commented 4 years ago

Works like a charm. Thanks 🥇

Will close this out after 0.2.6 tag if that works.

isaced commented 4 years ago

Released v0.2.6

thejeff77 commented 4 years ago

You're the best. Thanks.

iWeslie commented 4 years ago

The Pod is not updated yet. Please help.

-> Installing ISEmojiView (0.2.6)
 > Git download
 > Git download
     $ /usr/bin/git clone https://github.com/isaced/ISEmojiView.git
     /var/folders/l6/8nk8j_9j02dggl3_0hl29x_40000gn/T/d20200330-14308-g32s22 --template= --single-branch --depth 1 --branch
     0.2.5
     Cloning into '/var/folders/l6/8nk8j_9j02dggl3_0hl29x_40000gn/T/d20200330-14308-g32s22'...
     Note: switching to 'cd7fdd9be435b9545ca0d9a08c5e02dbcb8cc603'.
Screen Shot 2020-03-30 at 11 23 38 PM

@isaced

fadizant commented 4 years ago

Key preview doesn't take the dark mode effect. File

dustfire commented 3 years ago

hey guys this is not working on iOS14 / latest pod version.