weiran / Hackers

Hackers is an elegant iOS app for reading Hacker News written in Swift.
http://weiran.co/hackers
MIT License
696 stars 111 forks source link

Dynamic iOS 13 dark mode support #126

Closed EkilDeew closed 5 years ago

EkilDeew commented 5 years ago

Enabling dynamic dark mode theme responding to global iOS theme. There is a bit more work to be done like adding a switch to activate / deactivate this dynamic behavior and keep legacy behavior. Also minor color adjustment might be needed

weiran commented 5 years ago

Hi @EkilDeew,

Thanks for the PR! It looks like this depends on Xcode 11 to compile? Travis is failing with with your use of @available?

I also think this should be the default setting, but still allow iOS 13 users to override in Settings. Your "dynamic" theme could be called System then instead.

EkilDeew commented 5 years ago

Yes this require Xcode 11 to compile ! I will try to improve this PR and add options to override in Settings, maybe a second switch beneath the first dark mode toggle ?

Currently if the device is running iOS 13 this patch set the theme to dynamic by default. You can override it but I didn't add a toggle to reset to dynamic theme

weiran commented 5 years ago

I have an ios-13 branch which is what should be targeting iOS 13, master will need to stay on iOS 12 and Xcode 10 until the public release of iOS 13. On that branch there is a redesigned Settings in SwiftUI with a System option for the theme. Your changes should target that branch and the new SwiftUI Settings.

weiran commented 5 years ago

Closing this as the iOS 13 branch has implemented this in the new SwiftUI settings (not yet enabled).