Browse Source

examples/interop/ios-compose-in-uikit Color theme on UIKit page

pull/3596/head
dima.avdeev 1 year ago
parent
commit
13d427451d
  1. 8
      examples/interop/ios-compose-in-uikit/iosApp/iosApp/AppDelegate.swift

8
examples/interop/ios-compose-in-uikit/iosApp/iosApp/AppDelegate.swift

@ -46,7 +46,13 @@ class UIKitViewController: UIViewController {
label.textAlignment = .center
label.numberOfLines = 0
view.addSubview(label)
view.backgroundColor = .lightGray
view.backgroundColor = UIColor { collection in
switch collection.userInterfaceStyle {
case .light: return UIColor.white
case .dark: return UIColor.black
default: return UIColor.white
}
}
NSLayoutConstraint.activate([
label.centerYAnchor.constraint(equalTo: self.view.centerYAnchor),

Loading…
Cancel
Save