You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> This library lets a developer being awared of Dark Mode via a variable `DarkMode.style`. Also, with this library it is possible to change the value of Dark Mode in runtime easily.
26
+
> This library lets a developer being awared of Dark Mode via a variable `DarkMode.style`. Also, with this library it is possible to change the value of Dark Mode in runtime easily with standalone lib [DarkModeSwitching](https://gist.github.com/perseusrealdeal/11b1bab47f13134832b859f49d9af706).
27
27
28
-
## Reqirements
28
+
```swift
29
+
changeDarkModeManually(.off) // .on or .auto
30
+
```
31
+
Sample screen for changing Dark Mode option [here for macOS](https://github.com/perseusrealdeal/macos.darkmode.discovery) and [here for iOS](https://github.com/perseusrealdeal/ios.darkmode.discovery).
-[SwiftLint](https://github.com/realm/SwiftLint) / [0.31.0: Busy Laundromat](https://github.com/realm/SwiftLint/releases/tag/0.31.0) for macOS High Sierra
48
+
49
+
# Installation
38
50
39
-
## Installation
51
+
> ***Using "Exact" with the Version field is strongly recommended.***
40
52
41
-
###Step 1: Add PerseusDarkMode to a host project tree
53
+
## Step 1: Add PerseusDarkMode to a host project tree
42
54
43
-
####Standalone
55
+
### Standalone
44
56
45
57
Make a copy of the file [`PerseusDarkModeSingle.swift`](/PerseusDarkModeSingle.swift) then put it into a place required of a host project.
46
58
47
-
#### CocoaPods
59
+
### Carthage
60
+
61
+
Cartfile should contain:
62
+
63
+
```carthage
64
+
github "perseusrealdeal/PerseusDarkMode" == 1.1.5
65
+
```
66
+
67
+
Some Carthage usage tips placed [here](https://gist.github.com/perseusrealdeal/8951b10f4330325df6347aaaa79d3cf2).
68
+
69
+
### CocoaPods
48
70
49
71
Podfile should contain:
50
72
51
73
```ruby
52
74
target "ProjectTarget"do
53
75
use_frameworks!
54
-
pod 'PerseusDarkMode', '1.1.3'
76
+
pod 'PerseusDarkMode', '1.1.4'
55
77
end
56
78
```
57
-
#### Carthage
58
79
59
-
Cartfile should contain:
60
-
61
-
```carthage
62
-
github "perseusrealdeal/PerseusDarkMode" == 1.1.4
63
-
```
64
-
65
-
Some Carthage usage tips placed [here](https://gist.github.com/perseusrealdeal/8951b10f4330325df6347aaaa79d3cf2).
66
-
67
-
#### Swift Package Manager
80
+
### Swift Package Manager
68
81
69
82
- As a package dependency so Package.swift should contain the following statements:
Used functions are distributed via standalone file [`DarkModeSwitching.swift`](https://gist.github.com/perseusrealdeal/11b1bab47f13134832b859f49d9af706).
120
133
121
-
####iOS and macOS
134
+
### iOS and macOS
122
135
123
136
Call the method `AppearanceService.makeUp()` with the app's delegate if appearance changing is going to take place:
Copy the file [`DarkModeSwitching.swift`](https://gist.github.com/perseusrealdeal/11b1bab47f13134832b859f49d9af706) into a host project for having fun with manual changing Dark Mode value.
144
157
145
-
##Usage
158
+
# Usage
146
159
147
160
Each time if Dark Mode changed the mentioned method `#selector(makeUp)` called, but registering is required:
148
161
```swift
@@ -171,19 +184,21 @@ class MainViewController: UIViewController {
171
184
}
172
185
```
173
186
174
-
There is another way to be notified of Dark Mode—KVO. To learn have a look at [sample](https://github.com/perseusrealdeal/macos.darkmode.discovery) directly.
187
+
There is another way to be notified of Dark Mode—KVO.
188
+
189
+
> [`DarkModeImageView`](https://github.com/perseusrealdeal/PerseusUISystemKit/blob/master/Sources/PerseusUISystemKit/Classes/DarkModeImageView.swift) class is an expressive sample of Dark Mode KVO usage for both macOS and iOS as well.
0 commit comments