Skip to content

Commit 90b15ee

Browse files
hungtruongmluisbrown
authored andcommitted
Fix background colors in UIKit demos to work in light and dark mode (#482)
1 parent fabd1b6 commit 90b15ee

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

Examples/CaseStudies/UIKitCaseStudies/CounterViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class CounterViewController: UIViewController {
4040
override func viewDidLoad() {
4141
super.viewDidLoad()
4242

43-
self.view.backgroundColor = .white
43+
self.view.backgroundColor = .systemBackground
4444

4545
let decrementButton = UIButton(type: .system)
4646
decrementButton.addTarget(self, action: #selector(decrementButtonTapped), for: .touchUpInside)

Examples/CaseStudies/UIKitCaseStudies/Internal/ActivityIndicatorViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ final class ActivityIndicatorViewController: UIViewController {
44
override func viewDidLoad() {
55
super.viewDidLoad()
66

7-
self.view.backgroundColor = .white
7+
self.view.backgroundColor = .systemBackground
88

99
let activityIndicator = UIActivityIndicatorView()
1010
activityIndicator.startAnimating()

Examples/CaseStudies/UIKitCaseStudies/LoadThenNavigate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class LazyNavigationViewController: UIViewController {
6767

6868
self.title = "Load then navigate"
6969

70-
self.view.backgroundColor = .white
70+
self.view.backgroundColor = .systemBackground
7171

7272
let button = UIButton(type: .system)
7373
button.addTarget(self, action: #selector(loadOptionalCounterTapped), for: .touchUpInside)

Examples/CaseStudies/UIKitCaseStudies/NavigateAndLoad.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class EagerNavigationViewController: UIViewController {
6767

6868
self.title = "Navigate and load"
6969

70-
self.view.backgroundColor = .white
70+
self.view.backgroundColor = .systemBackground
7171

7272
let button = UIButton(type: .system)
7373
button.addTarget(self, action: #selector(loadOptionalCounterTapped), for: .touchUpInside)

Examples/TicTacToe/Sources/Views-UIKit/GameViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final class GameViewController: UIViewController {
2828
super.viewDidLoad()
2929

3030
self.navigationItem.title = "Tic-Tac-Toe"
31-
self.view.backgroundColor = .white
31+
self.view.backgroundColor = .systemBackground
3232

3333
self.navigationItem.leftBarButtonItem = UIBarButtonItem(
3434
title: "Quit",

Examples/TicTacToe/Sources/Views-UIKit/LoginViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class LoginViewController: UIViewController {
4141
super.viewDidLoad()
4242

4343
self.navigationItem.title = "Login"
44-
self.view.backgroundColor = .white
44+
self.view.backgroundColor = .systemBackground
4545

4646
let disclaimerLabel = UILabel()
4747
disclaimerLabel.text = """

Examples/TicTacToe/Sources/Views-UIKit/TwoFactorViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public final class TwoFactorViewController: UIViewController {
3434
public override func viewDidLoad() {
3535
super.viewDidLoad()
3636

37-
self.view.backgroundColor = .white
37+
self.view.backgroundColor = .systemBackground
3838

3939
let titleLabel = UILabel()
4040
titleLabel.text = "Enter the one time code to continue"

0 commit comments

Comments
 (0)