Skip to content

Commit

Permalink
Demo: use .systemGray4 on iOS 13+
Browse files Browse the repository at this point in the history
  • Loading branch information
pronebird committed Aug 7, 2022
1 parent cfc1708 commit 52d45f9
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions InfiniteScrollViewDemoSwift/CustomInfiniteIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,10 @@ class CustomInfiniteIndicator: UIView {
}

private func defaultOuterColor() -> UIColor {
let defaultLightColor = UIColor.gray.withAlphaComponent(0.2)

if #available(iOS 13.0, tvOS 13, *) {
return UIColor { traitCollection -> UIColor in
switch traitCollection.userInterfaceStyle {
case .light, .unspecified:
return defaultLightColor
case .dark:
return UIColor.white.withAlphaComponent(0.5)
@unknown default:
fatalError()
}
}
return .systemGray4
} else {
return defaultLightColor
return .gray.withAlphaComponent(0.2)
}
}
}

0 comments on commit 52d45f9

Please sign in to comment.