Swiftpack.co - Swift Packages by perseusrealdeal

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.

Packages published by perseusrealdeal

perseusrealdeal/DarkMode 1.0.1
Dark Mode for iOS from 9.0 and higher
⭐️ 1
🕓 5 weeks ago
🔖 Release Notes

Releases

The markdown parsing is broken/disabled for release notes. Sorry about that, I'm chasing the source of a crash that's been bringing this website down for the last couple of days.
v1.0.1
5 weeks ago
Gives a control of Apple's device appearance mode. Used with UIKit and for iOS branch of Apple system tree. It brings the property named DarkMode via UIResponder extension to a screen object. ```swift extension UIResponder { var DarkMode: DarkModeProtocol { AppearanceService.shared }} ``` Using this property, current appearance mode can be easy accessed that is either light or dark. ```swift import UIKit import PerseusDarkMode class MyView: UIView { func functionName() { print("\(self.DarkMode.Style)") } } ``` There is the AppearanceService singleton object dedicated for managing Dark Mode: - Matching system's appearance mode: ```swift AppearanceService.processTraitCollectionDidChange(previousTraitCollection) ``` - Registering objects that should be sensitive to Dark Mode: ```swift AppearanceService.register(stakeholder: self, selector: #selector(makeUp)) ``` - Informing registered objects to change their appearance: ```swift AppearanceService.makeUp() ``` - Changing Dark Mode that can be off, on or auto: ```swift AppearanceService.DarkModeUserChoice = .on ``` As a satellite to Dark Mode library there is Adapted System UI library. Adapted System UI library brings system and semantic colors introduced in iOS 13 to early iOS releases. ```swift import UIKit import AdaptedSystemUI let view = UIView() view.backgroundColor = .systemBlue_Adapted ``` Happy coding!
iOS

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics