awkward / Tatsi

A drop-in replacement for UIImagePickerController with the ability to select multiple images and/or videos
MIT License
110 stars 30 forks source link

Add Dark Mode support and customisation #29

Closed AvdLee closed 4 years ago

AvdLee commented 4 years ago

This PR adds support for customization using a TatsiColors protocol. It also adds great support for dark mode by default which might even take away the need to apply custom styling.

Adding customized colors

This can simply be done by using the TatsiConfig.default.colors property which defaults to TatsiDefaultColors(). Simply create your custom struct applying to the TatsiColors protocol:

/// Defines colors that will be applied to the Tatsi elements.
public protocol TatsiColors {
    var background: UIColor { get }
    var secondaryBackground: UIColor { get }
    var tint: UIColor { get }
    var label: UIColor { get }
    var secondaryLabel: UIColor { get }
}

Albums overview

Light Dark
Screen Shot 2019-10-28 at 11 33 38 Screen Shot 2019-10-28 at 11 33 46

Recents

Light Dark
Screen Shot 2019-10-28 at 11 34 03 Screen Shot 2019-10-28 at 11 33 58
renssies commented 4 years ago

Ow and it would also be great if you could enable dark mode in the Example app as well, it just means changing the background colors :)

Correction: Just fixed this for you, it wasn't that much work 😛