From 26cffef4ed58d43e957ebff9e91ede9d9053ccd9 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 1 Dec 2022 12:28:39 +0100 Subject: [PATCH 1/6] Remove redundant `#available(iOS 13, *)` checks They always return `true` since the deployment version is 13.0, and will soon become 14.0. Only two have been left: - In `WidgetStyles.swift`, because it will change again when bumping the deployment target to 14+. - In `MainShareViewController.swift` because we might want to take the occasion to restructure that logic. See conversation at https://github.com/wordpress-mobile/WordPress-iOS/pull/19513#discussion_r1007829599 --- .../Activity/Filter/FilterChipButton.swift | 2 +- .../Blog/Blog + Me/GravatarButtonView.swift | 8 +------- ...DomainSuggestionsTableViewController.swift | 6 ++---- ...GutenbergWebNavigationViewController.swift | 4 +--- .../Gutenberg/Views/GutenGhostView.swift | 7 +------ .../Post/AuthorFilterViewController.swift | 6 +----- .../Post/PostTagPickerViewController.swift | 4 +--- .../Reader/Detail/WebView/ReaderWebView.swift | 20 ++++++++----------- .../ReaderInterestsStyleGuide.swift | 8 +------- .../Shared/TitleSubtitleTextfieldHeader.swift | 7 +------ .../Stats/Extensions/WPStyleGuide+Stats.swift | 7 +------ .../Countries/Map/CountriesMapView.swift | 9 ++++----- .../Stats/Today Widgets/WidgetStyles.swift | 8 +------- .../ExtensionPresentationController.swift | 4 ---- 14 files changed, 24 insertions(+), 76 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Activity/Filter/FilterChipButton.swift b/WordPress/Classes/ViewRelated/Activity/Filter/FilterChipButton.swift index f42f77f7d340..29b1894ea2e4 100644 --- a/WordPress/Classes/ViewRelated/Activity/Filter/FilterChipButton.swift +++ b/WordPress/Classes/ViewRelated/Activity/Filter/FilterChipButton.swift @@ -94,7 +94,7 @@ class FilterChipButton: UIView { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - if #available(iOS 13, *), traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { + if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { applyColors() } } diff --git a/WordPress/Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift b/WordPress/Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift index 9900f73d9c41..e300c000eac2 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift @@ -66,13 +66,7 @@ extension GravatarButtonView { extension GravatarButtonView { private struct StandardBorder { - static var color: UIColor { - if #available(iOS 13, *) { - return .separator - } - - return .gray(.shade20) - } + static var color: UIColor = .separator static let width = CGFloat(0.5) } diff --git a/WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainSuggestions/DomainSuggestionsTableViewController.swift b/WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainSuggestions/DomainSuggestionsTableViewController.swift index 9c19d438bcfe..68ffa48f0718 100644 --- a/WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainSuggestions/DomainSuggestionsTableViewController.swift +++ b/WordPress/Classes/ViewRelated/Domains/Domain registration/RegisterDomainSuggestions/DomainSuggestionsTableViewController.swift @@ -118,10 +118,8 @@ class DomainSuggestionsTableViewController: UITableViewController { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - if #available(iOS 13, *) { - if traitCollection.userInterfaceStyle != previousTraitCollection?.userInterfaceStyle { - tableView.reloadData() - } + if traitCollection.userInterfaceStyle != previousTraitCollection?.userInterfaceStyle { + tableView.reloadData() } } diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergWeb/GutenbergWebNavigationViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergWeb/GutenbergWebNavigationViewController.swift index c8848adca7ce..c90ec306a1b7 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergWeb/GutenbergWebNavigationViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergWeb/GutenbergWebNavigationViewController.swift @@ -32,9 +32,7 @@ class GutenbergWebNavigationController: UINavigationController { super.present(viewControllerToPresent, animated: flag, completion: completion) } - guard - #available(iOS 13, *), - let menuViewControllerClass = NSClassFromString("UIDocumentMenuViewController"), // Silence deprecation warning. + guard let menuViewControllerClass = NSClassFromString("UIDocumentMenuViewController"), // Silence deprecation warning. viewControllerToPresent.isKind(of: menuViewControllerClass), UIDevice.current.userInterfaceIdiom == .phone else { diff --git a/WordPress/Classes/ViewRelated/Gutenberg/Views/GutenGhostView.swift b/WordPress/Classes/ViewRelated/Gutenberg/Views/GutenGhostView.swift index feeb473d9eff..2560602b3dd6 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/Views/GutenGhostView.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/Views/GutenGhostView.swift @@ -93,12 +93,7 @@ class GutenGhostView: UIView { } private extension UIColor { - static var ghostToolbarBackground: UIColor { - if #available(iOS 13, *) { - return UIColor(light: .clear, dark: UIColor.colorFromHex("2e2e2e")) - } - return .clear - } + static var ghostToolbarBackground: UIColor = UIColor(light: .clear, dark: UIColor.colorFromHex("2e2e2e")) static var ghostBlockBackground: UIColor { return UIColor(light: .clear, dark: .systemGray5) diff --git a/WordPress/Classes/ViewRelated/Post/AuthorFilterViewController.swift b/WordPress/Classes/ViewRelated/Post/AuthorFilterViewController.swift index a49adeb0b82e..e8182a810192 100644 --- a/WordPress/Classes/ViewRelated/Post/AuthorFilterViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/AuthorFilterViewController.swift @@ -48,11 +48,7 @@ class AuthorFilterViewController: UITableViewController { tableView.separatorColor = .clear tableView.isScrollEnabled = false tableView.showsVerticalScrollIndicator = false - if #available(iOS 13, *) { - tableView.contentInset = .zero - } else { - tableView.contentInset = UIEdgeInsets(top: -Metrics.topinset, left: 0, bottom: 0, right: 0) - } + tableView.contentInset = .zero } required init?(coder aDecoder: NSCoder) { diff --git a/WordPress/Classes/ViewRelated/Post/PostTagPickerViewController.swift b/WordPress/Classes/ViewRelated/Post/PostTagPickerViewController.swift index b86bb9f771fa..ad9a01117b44 100644 --- a/WordPress/Classes/ViewRelated/Post/PostTagPickerViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/PostTagPickerViewController.swift @@ -145,9 +145,7 @@ class PostTagPickerViewController: UIViewController { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - if #available(iOS 13, *) { - textViewContainer.layer.borderColor = UIColor.divider.cgColor - } + textViewContainer.layer.borderColor = UIColor.divider.cgColor } @objc func doneButtonPressed() { diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift index ab81ebb52146..7cac5bde8ef2 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift @@ -159,19 +159,15 @@ class ReaderWebView: WKWebView { /// Maps app colors to CSS colors to be applied in the webview /// private func cssColors() -> String { - if #available(iOS 13, *) { - return """ - @media (prefers-color-scheme: dark) { - \(mappedCSSColors(.dark)) - } - - @media (prefers-color-scheme: light) { - \(mappedCSSColors(.light)) - } - """ - } + return """ + @media (prefers-color-scheme: dark) { + \(mappedCSSColors(.dark)) + } - return lightCSSColors() + @media (prefers-color-scheme: light) { + \(mappedCSSColors(.light)) + } + """ } /// If iOS 13, returns light and dark colors diff --git a/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderInterestsStyleGuide.swift b/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderInterestsStyleGuide.swift index a96b291bea3f..1e4b8c9a68e7 100644 --- a/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderInterestsStyleGuide.swift +++ b/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderInterestsStyleGuide.swift @@ -36,13 +36,7 @@ class ReaderInterestsStyleGuide { } // MARK: - Next Button - public class var buttonContainerViewBackgroundColor: UIColor { - if #available(iOS 13, *) { - return .tertiarySystemBackground - } - - return .white - } + public static var buttonContainerViewBackgroundColor: UIColor = .tertiarySystemBackground public class func applyNextButtonStyle(button: FancyButton) { let disabledBackgroundColor: UIColor diff --git a/WordPress/Classes/ViewRelated/Site Creation/Shared/TitleSubtitleTextfieldHeader.swift b/WordPress/Classes/ViewRelated/Site Creation/Shared/TitleSubtitleTextfieldHeader.swift index f9ed8456df15..c55287847eb0 100644 --- a/WordPress/Classes/ViewRelated/Site Creation/Shared/TitleSubtitleTextfieldHeader.swift +++ b/WordPress/Classes/ViewRelated/Site Creation/Shared/TitleSubtitleTextfieldHeader.swift @@ -90,12 +90,7 @@ final class SearchTextField: UITextField { }() private lazy var activityIndicator: UIActivityIndicatorView = { - let activityIndicator: UIActivityIndicatorView - if #available(iOS 13, *) { - activityIndicator = UIActivityIndicatorView(style: .medium) - } else { - activityIndicator = UIActivityIndicatorView(style: .gray) - } + let activityIndicator = UIActivityIndicatorView(style: .medium) activityIndicator.backgroundColor = UIColor.clear return activityIndicator diff --git a/WordPress/Classes/ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift b/WordPress/Classes/ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift index 0e58e7a60aa0..07008a349373 100644 --- a/WordPress/Classes/ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift +++ b/WordPress/Classes/ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift @@ -262,12 +262,7 @@ extension WPStyleGuide { static let selectedDay = UIColor.accent } - static var mapBackground: UIColor { - if #available(iOS 13, *) { - return .systemGray4 - } - return .neutral(.shade10) - } + static var mapBackground: UIColor = .systemGray4 // MARK: - Posting Activity Collection View Styles diff --git a/WordPress/Classes/ViewRelated/Stats/Period Stats/Countries/Map/CountriesMapView.swift b/WordPress/Classes/ViewRelated/Stats/Period Stats/Countries/Map/CountriesMapView.swift index 021427b36544..51a47556c6ef 100644 --- a/WordPress/Classes/ViewRelated/Stats/Period Stats/Countries/Map/CountriesMapView.swift +++ b/WordPress/Classes/ViewRelated/Stats/Period Stats/Countries/Map/CountriesMapView.swift @@ -67,12 +67,11 @@ private extension CountriesMapView { } func mapColors() -> [UIColor] { - if #available(iOS 13, *) { - if traitCollection.userInterfaceStyle == .dark { - return [.primary(.shade90), .primary] - } + if traitCollection.userInterfaceStyle == .dark { + return [.primary(.shade90), .primary] + } else { + return [.primary(.shade5), .primary] } - return [.primary(.shade5), .primary] } func setGradientColors() { diff --git a/WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift b/WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift index a6a175c84fda..559f6c57c071 100644 --- a/WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift +++ b/WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift @@ -8,13 +8,7 @@ class WidgetStyles: NSObject { static let headlineFont = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .headline).pointSize) static let footnoteNote = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .footnote).pointSize) - static var separatorColor: UIColor = { - if #available(iOS 13, *) { - return .separator - } else { - return .divider - } - }() + static var separatorColor: UIColor = .separator static var separatorVibrancyEffect: UIVibrancyEffect = { if #available(iOS 13, *) { diff --git a/WordPress/WordPressShareExtension/ExtensionPresentationController.swift b/WordPress/WordPressShareExtension/ExtensionPresentationController.swift index d82ec27a8ca2..80a128dfceec 100644 --- a/WordPress/WordPressShareExtension/ExtensionPresentationController.swift +++ b/WordPress/WordPressShareExtension/ExtensionPresentationController.swift @@ -63,10 +63,6 @@ class ExtensionPresentationController: UIPresentationController { presentedView?.layer.cornerRadius = Appearance.cornerRadius presentedView?.clipsToBounds = true } - guard #available(iOS 13, *) else { - presentedView?.frame = frameOfPresentedViewInContainerView - return - } presentedView?.frame = viewFrame } From 3e32da4d4684a6ecb923adf857917fa64808bc3e Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 27 Oct 2022 11:16:31 +1100 Subject: [PATCH 2/6] Convert a few `static var` to `static let` Co-authored-by: Olivier Halligon --- .../Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift | 2 +- .../Reader/Select Interests/ReaderInterestsStyleGuide.swift | 2 +- .../ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift | 2 +- .../Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift b/WordPress/Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift index e300c000eac2..d5e31c5dea59 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blog + Me/GravatarButtonView.swift @@ -66,7 +66,7 @@ extension GravatarButtonView { extension GravatarButtonView { private struct StandardBorder { - static var color: UIColor = .separator + static let color: UIColor = .separator static let width = CGFloat(0.5) } diff --git a/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderInterestsStyleGuide.swift b/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderInterestsStyleGuide.swift index 1e4b8c9a68e7..1ca1bbd77cd4 100644 --- a/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderInterestsStyleGuide.swift +++ b/WordPress/Classes/ViewRelated/Reader/Select Interests/ReaderInterestsStyleGuide.swift @@ -36,7 +36,7 @@ class ReaderInterestsStyleGuide { } // MARK: - Next Button - public static var buttonContainerViewBackgroundColor: UIColor = .tertiarySystemBackground + public static let buttonContainerViewBackgroundColor: UIColor = .tertiarySystemBackground public class func applyNextButtonStyle(button: FancyButton) { let disabledBackgroundColor: UIColor diff --git a/WordPress/Classes/ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift b/WordPress/Classes/ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift index 07008a349373..654daf5ea19e 100644 --- a/WordPress/Classes/ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift +++ b/WordPress/Classes/ViewRelated/Stats/Extensions/WPStyleGuide+Stats.swift @@ -262,7 +262,7 @@ extension WPStyleGuide { static let selectedDay = UIColor.accent } - static var mapBackground: UIColor = .systemGray4 + static let mapBackground: UIColor = .systemGray4 // MARK: - Posting Activity Collection View Styles diff --git a/WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift b/WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift index 559f6c57c071..3fe37a6765d4 100644 --- a/WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift +++ b/WordPress/Classes/ViewRelated/Stats/Today Widgets/WidgetStyles.swift @@ -8,7 +8,7 @@ class WidgetStyles: NSObject { static let headlineFont = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .headline).pointSize) static let footnoteNote = UIFont.systemFont(ofSize: UIFont.preferredFont(forTextStyle: .footnote).pointSize) - static var separatorColor: UIColor = .separator + static let separatorColor: UIColor = .separator static var separatorVibrancyEffect: UIVibrancyEffect = { if #available(iOS 13, *) { From 77e333382001381b4a96d18f85df97639462de43 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 27 Oct 2022 11:16:48 +1100 Subject: [PATCH 3/6] Update all computed `static` colors to `static let` in `GutenGhostView` Maybe due to a recent Swift improvement, we are now able to declare `static var` and `static let` within an `extension`. There's no need to compute the value at runtime anymore. --- .../Gutenberg/Views/GutenGhostView.swift | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/Views/GutenGhostView.swift b/WordPress/Classes/ViewRelated/Gutenberg/Views/GutenGhostView.swift index 2560602b3dd6..923489ee88c6 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/Views/GutenGhostView.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/Views/GutenGhostView.swift @@ -93,17 +93,11 @@ class GutenGhostView: UIView { } private extension UIColor { - static var ghostToolbarBackground: UIColor = UIColor(light: .clear, dark: UIColor.colorFromHex("2e2e2e")) + static let ghostToolbarBackground = UIColor(light: .clear, dark: UIColor.colorFromHex("2e2e2e")) - static var ghostBlockBackground: UIColor { - return UIColor(light: .clear, dark: .systemGray5) - } + static let ghostBlockBackground = UIColor(light: .clear, dark: .systemGray5) - static var beatEndColor: UIColor { - return UIColor(light: .systemGray6, dark: .clear) - } + static let beatEndColor = UIColor(light: .systemGray6, dark: .clear) - static var background: UIColor { - return .systemBackground - } + static let background = UIColor.systemBackground } From 4bb1cdfb024dfade1574d9adc7aa096bbc3882cf Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 1 Dec 2022 12:36:30 +0100 Subject: [PATCH 4/6] Remove redundant `@available(iOS 13, *)` annotations The deployment version is 13.0 making these methods always available. --- .../ViewRelated/Reader/Detail/WebView/ReaderWebView.swift | 3 --- .../ViewRelated/Views/WPRichText/WPRichContentView.swift | 1 - 2 files changed, 4 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift index 7cac5bde8ef2..f099f082eebf 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift @@ -170,9 +170,6 @@ class ReaderWebView: WKWebView { """ } - /// If iOS 13, returns light and dark colors - /// - @available(iOS 13, *) private func mappedCSSColors(_ style: UIUserInterfaceStyle) -> String { let trait = UITraitCollection(userInterfaceStyle: style) UIColor(light: .muriel(color: .gray, .shade40), diff --git a/WordPress/Classes/ViewRelated/Views/WPRichText/WPRichContentView.swift b/WordPress/Classes/ViewRelated/Views/WPRichText/WPRichContentView.swift index edd0e95db7c3..c85024959db4 100644 --- a/WordPress/Classes/ViewRelated/Views/WPRichText/WPRichContentView.swift +++ b/WordPress/Classes/ViewRelated/Views/WPRichText/WPRichContentView.swift @@ -76,7 +76,6 @@ class WPRichContentView: UITextView { return formattedAttributedString(for: string, style: style) } - @available(iOS 13, *) class func formattedAttributedString(for string: String, style: UIUserInterfaceStyle) -> NSAttributedString { let trait = UITraitCollection(userInterfaceStyle: style) let style = AttributedStringStyle(textColorHex: UIColor.text.color(for: trait).hexString() ?? fallbackTextColorHex, From b2a912800581de0fcd0eb45fd10f908686a8f05b Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Thu, 1 Dec 2022 12:37:52 +0100 Subject: [PATCH 5/6] Remove unused `lightCSSColors` method It was already unused, but I noticed that in the previous commit, 4bb1cdfb024dfade1574d9adc7aa096bbc3882cf, which made it clear it was an iOS-12-specific method and therefore no longer relevant for us. --- .../Reader/Detail/WebView/ReaderWebView.swift | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift index f099f082eebf..e395fb95af96 100644 --- a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift +++ b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift @@ -189,21 +189,4 @@ class ReaderWebView: WKWebView { } """ } - - /// If iOS 12 or below, returns only light colors - /// - private func lightCSSColors() -> String { - return """ - :root { - --color-text: #\(UIColor.text.hexString() ?? ""); - --color-neutral-0: #\(UIColor.listForegroundUnread.hexString() ?? ""); - --color-neutral-10: #\(UIColor(color: .muriel(color: .gray, .shade10)).hexString() ?? ""); - --color-neutral-40: #\(UIColor(color: .muriel(color: .gray, .shade40)).hexString() ?? ""); - --color-neutral-50: #\(UIColor.textSubtle.hexString() ?? ""); - --color-neutral-70: #\(UIColor.text.hexString() ?? ""); - --main-link-color: #\(UIColor.primary.hexString() ?? ""); - --main-link-active-color: #\(UIColor.primaryDark.hexString() ?? ""); - } - """ - } } From 9f440b112389e029b9ff3c3c466a591d8d8c1653 Mon Sep 17 00:00:00 2001 From: Gio Lodi Date: Fri, 2 Dec 2022 05:18:21 +0100 Subject: [PATCH 6/6] Remove redundant `#available(iOS 13.4, *)` check The app targets iOS 14.0+ and the check would always return `true`. --- .../Time Selector/TimeSelectionView.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Blog/Blogging Reminders/Time Selector/TimeSelectionView.swift b/WordPress/Classes/ViewRelated/Blog/Blogging Reminders/Time Selector/TimeSelectionView.swift index 56292412b4a8..8bd112f7d8f9 100644 --- a/WordPress/Classes/ViewRelated/Blog/Blogging Reminders/Time Selector/TimeSelectionView.swift +++ b/WordPress/Classes/ViewRelated/Blog/Blogging Reminders/Time Selector/TimeSelectionView.swift @@ -7,11 +7,7 @@ class TimeSelectionView: UIView { private lazy var timePicker: UIDatePicker = { let datePicker = UIDatePicker() - - if #available(iOS 13.4, *) { - datePicker.preferredDatePickerStyle = .wheels - } - + datePicker.preferredDatePickerStyle = .wheels datePicker.datePickerMode = .time datePicker.translatesAutoresizingMaskIntoConstraints = false datePicker.setDate(selectedTime, animated: false)