Skip to content

Commit 0f02f5f

Browse files
committed
Update demos for Xcode 11 and Swift 5.1.
1 parent f9d117c commit 0f02f5f

18 files changed

Lines changed: 104 additions & 640 deletions

Example/Gallery/FrameView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import WolfKit
99
import LifeHash
1010
import UIImageColors
11+
import UIKit
1112

1213
class FrameView: View {
1314
private lazy var imageView = LifeHashView() {

Example/Gallery/GroupView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77

88
import WolfKit
9+
import UIKit
910

1011
class GroupView: View {
1112
private lazy var columnStackView = StackView() |> vertical |> distribution(.fillEqually)

Example/Gallery/LifeHashUtils.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import WolfKit
22
import LifeHash
33
import simd
4+
import UIKit
45

56
extension LifeHash {
67
private static let serializer = Serializer()

Example/Gallery/LifeHashView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import WolfKit
99
import LifeHash
10+
import UIKit
1011

1112
protocol Fingerprintable {
1213
var fingerprintInput: Data { get }

Example/Gallery/ViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class MainViewController: ViewController {
6767
private var canceler: Cancelable?
6868

6969
private func startTimer() {
70-
canceler = dispatchRepeatedOnMain(atInterval: 20) { [unowned self] _ in
70+
canceler = dispatchRepeatedOnMain(atInterval: 10) { [unowned self] _ in
7171
self.updateImage(animated: true)
7272
}
7373
}

Example/LifeHash.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 10 deletions
This file was deleted.

Example/LifeHash/DetailViewController.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// SOFTWARE.
2424

2525
import WolfKit
26+
import UIKit
2627

2728
class DetailViewController: ViewController {
2829
private typealias `Self` = DetailViewController
@@ -50,7 +51,7 @@ class DetailViewController: ViewController {
5051

5152
private lazy var label = Label() { (🍒: Label) in
5253
🍒.font = Self.font
53-
🍒.textColor = .gray
54+
🍒.textColor = .label
5455
🍒.textAlignment = .center
5556
}
5657

@@ -96,4 +97,14 @@ class DetailViewController: ViewController {
9697
self.dismiss()
9798
}
9899
}
100+
101+
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
102+
super.traitCollectionDidChange(previousTraitCollection)
103+
104+
if isDarkMode(self) {
105+
blurView.effect = UIBlurEffect(style: .dark)
106+
} else {
107+
blurView.effect = UIBlurEffect(style: .light)
108+
}
109+
}
99110
}

Example/LifeHash/LifeHashCollectionViewCell.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import Foundation
2626
import WolfKit
2727
import LifeHash
28+
import UIKit
2829

2930
class LifeHashCollectionViewCell: CollectionViewCell {
3031
private typealias `Self` = LifeHashCollectionViewCell
@@ -56,7 +57,7 @@ class LifeHashCollectionViewCell: CollectionViewCell {
5657

5758
private lazy var label = Label() { (🍒: Label) in
5859
🍒.font = Self.font
59-
🍒.textColor = .gray
60+
🍒.textColor = .label
6061
🍒.textAlignment = .center
6162
🍒.constrainHeight(to: Self.labelHeight)
6263
}

Example/LifeHash/LifeHashView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import LifeHash
2626
import WolfKit
27+
import UIKit
2728

2829
class LifeHashView: ImageView {
2930
private typealias `Self` = LifeHashView

Example/LifeHash/MainViewController.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// SOFTWARE.
2424

2525
import WolfKit
26+
import UIKit
2627

2728
class MainViewController: ViewController {
2829
private lazy var collectionViewLayout = UICollectionViewFlowLayout() { 🍒 in
@@ -35,7 +36,7 @@ class MainViewController: ViewController {
3536
🍒.register(LifeHashCollectionViewCell.self, forCellWithReuseIdentifier: "LifeHash")
3637
🍒.dataSource = self
3738
🍒.delegate = self
38-
🍒.backgroundColor = .black
39+
🍒.backgroundColor = .systemBackground
3940
🍒.contentInset = UIEdgeInsets(all: 20)
4041
}
4142

@@ -48,7 +49,7 @@ class MainViewController: ViewController {
4849

4950
collectionView.constrainFrameToFrame()
5051

51-
navigationController!.navigationBar.barStyle = .blackTranslucent
52+
navigationController!.navigationBar.isTranslucent = true
5253
}
5354

5455
override var preferredStatusBarStyle: UIStatusBarStyle {

0 commit comments

Comments
 (0)