diff --git a/iphone/DatePicker/DatePicker/Cells/RangeFirstCell.swift b/iphone/DatePicker/DatePicker/Cells/RangeFirstCell.swift index be85de66c..daf5aaa81 100644 --- a/iphone/DatePicker/DatePicker/Cells/RangeFirstCell.swift +++ b/iphone/DatePicker/DatePicker/Cells/RangeFirstCell.swift @@ -7,9 +7,7 @@ final class RangeFirstCell: Cell { contentView.addSubview(rangeBgView) rangeBgView.alignToSuperview(UIEdgeInsets(top: 4, left: 4, bottom: -4, right: 0)) rangeBgView.layer.cornerRadius = 8 - if #available(iOS 13.0, *) { - rangeBgView.layer.cornerCurve = .continuous - } + rangeBgView.layer.cornerCurve = .continuous rangeBgView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMinXMaxYCorner] super.addSubviews() } diff --git a/iphone/DatePicker/DatePicker/Cells/RangeLastCell.swift b/iphone/DatePicker/DatePicker/Cells/RangeLastCell.swift index 5aa7d902d..dcd949564 100644 --- a/iphone/DatePicker/DatePicker/Cells/RangeLastCell.swift +++ b/iphone/DatePicker/DatePicker/Cells/RangeLastCell.swift @@ -7,9 +7,7 @@ final class RangeLastCell: Cell { contentView.addSubview(rangeBgView) rangeBgView.alignToSuperview(UIEdgeInsets(top: 4, left: 0, bottom: -4, right: -4)) rangeBgView.layer.cornerRadius = 8 - if #available(iOS 13.0, *) { - rangeBgView.layer.cornerCurve = .continuous - } + rangeBgView.layer.cornerCurve = .continuous rangeBgView.layer.maskedCorners = [.layerMaxXMinYCorner, .layerMaxXMaxYCorner] super.addSubviews() } diff --git a/iphone/DatePicker/DatePicker/Cells/RangeSingleCell.swift b/iphone/DatePicker/DatePicker/Cells/RangeSingleCell.swift index f36ecc46a..7c48da018 100644 --- a/iphone/DatePicker/DatePicker/Cells/RangeSingleCell.swift +++ b/iphone/DatePicker/DatePicker/Cells/RangeSingleCell.swift @@ -7,9 +7,7 @@ final class RangeSingleCell: Cell { contentView.addSubview(rangeBgView) rangeBgView.alignToSuperview(UIEdgeInsets(top: 4, left: 4, bottom: -4, right: -4)) rangeBgView.layer.cornerRadius = 8 - if #available(iOS 13.0, *) { - rangeBgView.layer.cornerCurve = .continuous - } + rangeBgView.layer.cornerCurve = .continuous super.addSubviews() } diff --git a/iphone/DatePicker/DatePicker/Cells/SelectedSingleCell.swift b/iphone/DatePicker/DatePicker/Cells/SelectedSingleCell.swift index 332c7fe45..9a7eecafa 100644 --- a/iphone/DatePicker/DatePicker/Cells/SelectedSingleCell.swift +++ b/iphone/DatePicker/DatePicker/Cells/SelectedSingleCell.swift @@ -7,9 +7,7 @@ class SelectedSingleCell: Cell { contentView.addSubview(selectedBgView) selectedBgView.alignToSuperview(UIEdgeInsets(top: 4, left: 4, bottom: -4, right: -4)) selectedBgView.layer.cornerRadius = 8 - if #available(iOS 13.0, *) { - selectedBgView.layer.cornerCurve = .continuous - } + selectedBgView.layer.cornerCurve = .continuous super.addSubviews() } diff --git a/iphone/Maps/Categories/CALayer+SetCorner.swift b/iphone/Maps/Categories/CALayer+SetCorner.swift index 7b49343a8..e56b53ff2 100644 --- a/iphone/Maps/Categories/CALayer+SetCorner.swift +++ b/iphone/Maps/Categories/CALayer+SetCorner.swift @@ -5,9 +5,7 @@ extension CALayer { if let maskedCorners { self.maskedCorners = maskedCorners } - if #available(iOS 13.0, *) { - cornerCurve = .continuous - } + cornerCurve = .continuous } } diff --git a/iphone/Maps/Classes/CarPlay/CarPlayService.swift b/iphone/Maps/Classes/CarPlay/CarPlayService.swift index 9fde1621b..9b32ea950 100644 --- a/iphone/Maps/Classes/CarPlay/CarPlayService.swift +++ b/iphone/Maps/Classes/CarPlay/CarPlayService.swift @@ -54,9 +54,7 @@ final class CarPlayService: NSObject { applyBaseRootTemplate() router.restoreTripPreviewOnCarplay(beforeRootTemplateDidAppear: true) } - if #available(iOS 13.0, *) { - updateContentStyle(configuration.contentStyle) - } + updateContentStyle(configuration.contentStyle) FrameworkHelper.updatePositionArrowOffset(false, offset: 5) CarPlayWindowScaleAdjuster.updateAppearance( diff --git a/iphone/Maps/Classes/CarPlay/Template Builders/ListTemplateBuilder.swift b/iphone/Maps/Classes/CarPlay/Template Builders/ListTemplateBuilder.swift index 5f48557e4..65098f05c 100644 --- a/iphone/Maps/Classes/CarPlay/Template Builders/ListTemplateBuilder.swift +++ b/iphone/Maps/Classes/CarPlay/Template Builders/ListTemplateBuilder.swift @@ -96,14 +96,12 @@ final class ListTemplateBuilder { bookmarkId: bookmark.bookmarkId)) return item }) - if #available(iOS 15.0, *) { - let maxItemCount = CPListTemplate.maximumItemCount - 1 - if items.count >= maxItemCount { - items = Array(items.prefix(maxItemCount)) - let cropWarning = CPListItem(text: L("not_all_shown_bookmarks_carplay"), detailText: L("switch_to_phone_bookmarks_carplay")) - cropWarning.isEnabled = false - items.append(cropWarning) - } + let maxItemCount = CPListTemplate.maximumItemCount - 1 + if items.count >= maxItemCount { + items = Array(items.prefix(maxItemCount)) + let cropWarning = CPListItem(text: L("not_all_shown_bookmarks_carplay"), detailText: L("switch_to_phone_bookmarks_carplay")) + cropWarning.isEnabled = false + items.append(cropWarning) } let section = CPListSection(items: items) template.updateSections([section]) diff --git a/iphone/Maps/Classes/Components/CopyableLabel.swift b/iphone/Maps/Classes/Components/CopyableLabel.swift index 3f90df4c1..1bf77b40c 100644 --- a/iphone/Maps/Classes/Components/CopyableLabel.swift +++ b/iphone/Maps/Classes/Components/CopyableLabel.swift @@ -29,12 +29,7 @@ class CopyableLabel: UILabel { var rect = bounds rect.origin = locationOfTouchInLabel rect.size = CGSize(width: 1, height: 1) - if #available(iOS 13, *) { - menu.showMenu(from: self, rect: rect) - } else { - menu.setTargetRect(rect, in: self) - menu.setMenuVisible(true, animated: false) - } + menu.showMenu(from: self, rect: rect) } } diff --git a/iphone/Maps/Classes/LoadingOverlay/LoadingOverlayViewController.swift b/iphone/Maps/Classes/LoadingOverlay/LoadingOverlayViewController.swift index 6ed26097d..3d6439efc 100644 --- a/iphone/Maps/Classes/LoadingOverlay/LoadingOverlayViewController.swift +++ b/iphone/Maps/Classes/LoadingOverlay/LoadingOverlayViewController.swift @@ -1,11 +1,7 @@ final class LoadingOverlayViewController: UIViewController { private var activityIndicator: UIActivityIndicatorView = { let indicator: UIActivityIndicatorView - if #available(iOS 13.0, *) { - indicator = UIActivityIndicatorView(style: .large) - } else { - indicator = UIActivityIndicatorView(style: .whiteLarge) - } + indicator = UIActivityIndicatorView(style: .large) indicator.color = .white indicator.startAnimating() indicator.translatesAutoresizingMaskIntoConstraints = false diff --git a/iphone/Maps/Common/Common.swift b/iphone/Maps/Common/Common.swift index a54a7bcce..241eb5b6a 100644 --- a/iphone/Maps/Common/Common.swift +++ b/iphone/Maps/Common/Common.swift @@ -1,7 +1,7 @@ import Foundation var isiPad: Bool { - if #available(iOS 14.0, *), ProcessInfo.processInfo.isiOSAppOnMac { + if ProcessInfo.processInfo.isiOSAppOnMac { return true } return UIDevice.current.userInterfaceIdiom == .pad diff --git a/iphone/Maps/Core/Theme/Core/StyleManager.swift b/iphone/Maps/Core/Theme/Core/StyleManager.swift index 3ab8a2485..3394f6809 100644 --- a/iphone/Maps/Core/Theme/Core/StyleManager.swift +++ b/iphone/Maps/Core/Theme/Core/StyleManager.swift @@ -45,10 +45,6 @@ listener.applyTheme() } } - - if #available(iOS 13, *) {} else { - UISearchBarRenderer.setAppearance() - } } private func updateView(_ view: UIView?) { diff --git a/iphone/Maps/Core/Theme/Core/ThemeManager.swift b/iphone/Maps/Core/Theme/Core/ThemeManager.swift index f00d5bba7..f520ec011 100644 --- a/iphone/Maps/Core/Theme/Core/ThemeManager.swift +++ b/iphone/Maps/Core/Theme/Core/ThemeManager.swift @@ -10,9 +10,7 @@ final class ThemeManager: NSObject { } private func update(theme: MWMTheme) { - if #available(iOS 13.0, *) { - updateSystemUserInterfaceStyle(theme) - } + updateSystemUserInterfaceStyle(theme) let actualTheme: MWMTheme = { theme in let isVehicleRouting = MWMRouter.isRoutingActive() && (MWMRouter.type() == .vehicle) @@ -22,19 +20,9 @@ final class ThemeManager: NSObject { case .night: fallthrough case .vehicleNight: return isVehicleRouting ? .vehicleNight : .night case .auto: - if #available(iOS 13.0, *) { - let isDarkModeEnabled = UIScreen.main.traitCollection.userInterfaceStyle == .dark - guard isVehicleRouting else { return isDarkModeEnabled ? .night : .day } - return isDarkModeEnabled ? .vehicleNight : .vehicleDay - } else { - guard isVehicleRouting else { return .day } - switch FrameworkHelper.daytime(at: LocationManager.lastLocation()) { - case .day: return .vehicleDay - case .night: return .vehicleNight - @unknown default: - fatalError() - } - } + let isDarkModeEnabled = UIScreen.main.traitCollection.userInterfaceStyle == .dark + guard isVehicleRouting else { return isDarkModeEnabled ? .night : .day } + return isDarkModeEnabled ? .vehicleNight : .vehicleDay @unknown default: fatalError() } diff --git a/iphone/Maps/Core/Theme/Renderers/UINavigationBarRenderer.swift b/iphone/Maps/Core/Theme/Renderers/UINavigationBarRenderer.swift index 8c9091f6a..0cbfcaa5a 100644 --- a/iphone/Maps/Core/Theme/Renderers/UINavigationBarRenderer.swift +++ b/iphone/Maps/Core/Theme/Renderers/UINavigationBarRenderer.swift @@ -15,23 +15,15 @@ class UINavigationBarRenderer: UIViewRenderer { class func render(_ control: UINavigationBar, style: Style) { super.render(control, style: style) if let barTintColor = style.barTintColor { - if #available(iOS 13.0, *) { - let appearance = UINavigationBarAppearance() - appearance.configureWithOpaqueBackground() - appearance.backgroundColor = barTintColor - control.standardAppearance = appearance - control.scrollEdgeAppearance = appearance - } else { - control.barTintColor = barTintColor - } + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = barTintColor + control.standardAppearance = appearance + control.scrollEdgeAppearance = appearance } if let shadowImage = style.shadowImage { - if #available(iOS 13.0, *) { - control.standardAppearance.shadowImage = shadowImage - control.scrollEdgeAppearance!.shadowImage = shadowImage - } else { - control.shadowImage = shadowImage - } + control.standardAppearance.shadowImage = shadowImage + control.scrollEdgeAppearance!.shadowImage = shadowImage } var attributes = [NSAttributedString.Key: Any]() @@ -41,11 +33,7 @@ class UINavigationBarRenderer: UIViewRenderer { if let fontColor = style.fontColor { attributes[NSAttributedString.Key.foregroundColor] = fontColor } - if #available(iOS 13.0, *) { - control.standardAppearance.titleTextAttributes = attributes - control.scrollEdgeAppearance!.titleTextAttributes = attributes - } else { - control.titleTextAttributes = attributes - } + control.standardAppearance.titleTextAttributes = attributes + control.scrollEdgeAppearance!.titleTextAttributes = attributes } } diff --git a/iphone/Maps/Core/Theme/Renderers/UISearchBarRenderer.swift b/iphone/Maps/Core/Theme/Renderers/UISearchBarRenderer.swift index 25394df32..1cd18d3ce 100644 --- a/iphone/Maps/Core/Theme/Renderers/UISearchBarRenderer.swift +++ b/iphone/Maps/Core/Theme/Renderers/UISearchBarRenderer.swift @@ -24,43 +24,34 @@ extension UISearchBar { class UISearchBarRenderer: UIViewRenderer { class func render(_ control: UISearchBar, style: Style) { super.render(control, style: style) - if #available(iOS 13, *) { - let searchTextField = control.searchTextField - // Default search bar implementation adds the grey transparent image for background. This code removes it and updates the corner radius. This is not working on iPad designed for mac. - if #available(iOS 14.0, *), ProcessInfo.processInfo.isiOSAppOnMac { - } else { - control.setSearchFieldBackgroundImage(UIImage(), for: .normal) - } - searchTextField.layer.setCornerRadius(.buttonDefault) - searchTextField.layer.masksToBounds = true - // Placeholder color - if let placeholder = searchTextField.placeholder { - searchTextField.attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [.foregroundColor: UIColor.gray]) - } - if let backgroundColor = style.backgroundColor { - searchTextField.backgroundColor = backgroundColor - } - if let font = style.font { - searchTextField.font = font - } - if let fontColor = style.fontColor { - searchTextField.textColor = fontColor - } - if let tintColor = style.tintColor { - searchTextField.leftView?.tintColor = tintColor - // Placeholder indicator color - searchTextField.tintColor = tintColor - // Clear button image - let clearButtonImage = UIImage(named: "ic_clear")?.withRenderingMode(.alwaysTemplate).withTintColor(tintColor) - control.setImage(clearButtonImage, for: .clear, state: .normal) - } - } else { - // Default search bar implementation for iOS12 adds the dark grey transparent image for background. This code removes it and replace with the custom image accordingly to the documentation - see 'setSearchFieldBackgroundImage'. - if let backgroundColor = style.backgroundColor { - let image = getSearchBarBackgroundImage(color: backgroundColor) - control.setSearchFieldBackgroundImage(image, for: .normal) - control.searchTextPositionAdjustment = UIOffset(horizontal: 6.0, vertical: 0.0) - } + + let searchTextField = control.searchTextField + // Default search bar implementation adds the grey transparent image for background. This code removes it and updates the corner radius. This is not working on iPad designed for mac. + if !ProcessInfo.processInfo.isiOSAppOnMac { + control.setSearchFieldBackgroundImage(UIImage(), for: .normal) + } + searchTextField.layer.setCornerRadius(.buttonDefault) + searchTextField.layer.masksToBounds = true + // Placeholder color + if let placeholder = searchTextField.placeholder { + searchTextField.attributedPlaceholder = NSAttributedString(string: placeholder, attributes: [.foregroundColor: UIColor.gray]) + } + if let backgroundColor = style.backgroundColor { + searchTextField.backgroundColor = backgroundColor + } + if let font = style.font { + searchTextField.font = font + } + if let fontColor = style.fontColor { + searchTextField.textColor = fontColor + } + if let tintColor = style.tintColor { + searchTextField.leftView?.tintColor = tintColor + // Placeholder indicator color + searchTextField.tintColor = tintColor + // Clear button image + let clearButtonImage = UIImage(named: "ic_clear")?.withRenderingMode(.alwaysTemplate).withTintColor(tintColor) + control.setImage(clearButtonImage, for: .clear, state: .normal) } if let barTintColor = style.barTintColor { let position = control.delegate?.position?(for: control) ?? control.barPosition diff --git a/iphone/Maps/Core/Theme/Renderers/UIViewRenderer.swift b/iphone/Maps/Core/Theme/Renderers/UIViewRenderer.swift index a9de58e08..3b86e5e79 100644 --- a/iphone/Maps/Core/Theme/Renderers/UIViewRenderer.swift +++ b/iphone/Maps/Core/Theme/Renderers/UIViewRenderer.swift @@ -57,8 +57,6 @@ class UIViewRenderer { if let round = style.round, round == true { control.layer.cornerRadius = control.size.height / 2 } - if #available(iOS 13.0, *) { - control.layer.cornerCurve = .continuous - } + control.layer.cornerCurve = .continuous } } diff --git a/iphone/Maps/UI/ColorPicker/ColorPicker.swift b/iphone/Maps/UI/ColorPicker/ColorPicker.swift index b13cb4781..24ce4bf0e 100644 --- a/iphone/Maps/UI/ColorPicker/ColorPicker.swift +++ b/iphone/Maps/UI/ColorPicker/ColorPicker.swift @@ -21,7 +21,7 @@ final class ColorPicker: NSObject { switch pickerType { case .defaultColorPicker(let color): - if #available(iOS 14.0, *), !ProcessInfo.processInfo.isiOSAppOnMac { + if !ProcessInfo.processInfo.isiOSAppOnMac { colorPickerViewController = defaultColorPickerViewController(with: color) } else { colorPickerViewController = bookmarksColorPickerViewController(with: BookmarkColor.bookmarkColor(from: color) ?? .none) diff --git a/iphone/Maps/UI/DocumentPicker/DocumentPicker.swift b/iphone/Maps/UI/DocumentPicker/DocumentPicker.swift index ab65e61fe..91d797ce9 100644 --- a/iphone/Maps/UI/DocumentPicker/DocumentPicker.swift +++ b/iphone/Maps/UI/DocumentPicker/DocumentPicker.swift @@ -9,11 +9,7 @@ final class DocumentPicker: NSObject { completionHandler: @escaping URLsCompletionHandler) { self.completionHandler = completionHandler let documentPickerViewController: UIDocumentPickerViewController - if #available(iOS 14.0, *) { - documentPickerViewController = UIDocumentPickerViewController(forOpeningContentTypes: fileTypes.map(\.utType), asCopy: true) - } else { - documentPickerViewController = UIDocumentPickerViewController(documentTypes: fileTypes.map(\.typeIdentifier), in: .import) - } + documentPickerViewController = UIDocumentPickerViewController(forOpeningContentTypes: fileTypes.map(\.utType), asCopy: true) documentPickerViewController.delegate = self // TODO: Enable multiple selection when the multiple files parsing support will be added to the bookmark_manager. documentPickerViewController.allowsMultipleSelection = false diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePageEditBookmarkOrTrackViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePageEditBookmarkOrTrackViewController.swift index 07005f20a..93cd0d915 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePageEditBookmarkOrTrackViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageEditBookmarkOrTrackViewController.swift @@ -39,7 +39,7 @@ final class PlacePageEditBookmarkOrTrackViewController: UIViewController { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - if #available(iOS 13.0, *), traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { + if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { applyTheme() } } diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/CircleImageButton.swift b/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/CircleImageButton.swift index 1fafa0309..ca365a879 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/CircleImageButton.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/CircleImageButton.swift @@ -17,7 +17,7 @@ final class CircleImageButton: UIButton { override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) - if #available(iOS 13.0, *), traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { + if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { circleImageView.applyTheme() } } diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/PlacePageHeaderViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/PlacePageHeaderViewController.swift index b77bfda01..2681d73b7 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/PlacePageHeaderViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/PlacePageHeaderViewController.swift @@ -111,38 +111,21 @@ extension PlacePageHeaderViewController: PlacePageHeaderViewProtocol { } func showShareTrackMenu() { - if #available(iOS 14.0, *) { // The menu will be shown by the shareButton itself - } else { - let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) - let kmlAction = UIAlertAction(title: L("export_file"), style: .default) { [weak self] _ in - guard let self else { return } - self.presenter?.onExportTrackButtonPress(.text, from: self.shareButton) - } - let gpxAction = UIAlertAction(title: L("export_file_gpx"), style: .default) { [weak self] _ in - guard let self else { return } - self.presenter?.onExportTrackButtonPress(.gpx, from: self.shareButton) - } - alert.addAction(kmlAction) - alert.addAction(gpxAction) - present(alert, animated: true, completion: nil) - } } private func configureTrackSharingMenu() { - if #available(iOS 14.0, *) { - let menu = UIMenu(title: "", image: nil, children: [ - UIAction(title: L("export_file"), image: nil, handler: { [weak self] _ in - guard let self else { return } - self.presenter?.onExportTrackButtonPress(.text, from: self.shareButton) - }), - UIAction(title: L("export_file_gpx"), image: nil, handler: { [weak self] _ in - guard let self else { return } - self.presenter?.onExportTrackButtonPress(.gpx, from: self.shareButton) - }), - ]) - shareButton.menu = menu - shareButton.showsMenuAsPrimaryAction = true - } + let menu = UIMenu(title: "", image: nil, children: [ + UIAction(title: L("export_file"), image: nil, handler: { [weak self] _ in + guard let self else { return } + self.presenter?.onExportTrackButtonPress(.text, from: self.shareButton) + }), + UIAction(title: L("export_file_gpx"), image: nil, handler: { [weak self] _ in + guard let self else { return } + self.presenter?.onExportTrackButtonPress(.gpx, from: self.shareButton) + }), + ]) + shareButton.menu = menu + shareButton.showsMenuAsPrimaryAction = true } } diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift index d148e3586..f025dd373 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageInfoViewController.swift @@ -488,16 +488,15 @@ class PlacePageInfoViewController: UIViewController { longPressHandler: { [weak self] in self?.copyCoordinatesToPasteboard() }) - if #available(iOS 14.0, *) { - let menu = UIMenu(children: coordFormats.enumerated().map { (index, format) in - UIAction(title: format, handler: { [weak self] _ in - self?.setCoordinatesSelected(formatId: index) - self?.copyCoordinatesToPasteboard() - }) + + let menu = UIMenu(children: coordFormats.enumerated().map { (index, format) in + UIAction(title: format, handler: { [weak self] _ in + self?.setCoordinatesSelected(formatId: index) + self?.copyCoordinatesToPasteboard() }) - coordinatesView?.accessoryButton.menu = menu - coordinatesView?.accessoryButton.showsMenuAsPrimaryAction = true - } + }) + coordinatesView?.accessoryButton.menu = menu + coordinatesView?.accessoryButton.showsMenuAsPrimaryAction = true } private func setCoordinatesSelected(formatId: Int) { diff --git a/iphone/Maps/UI/PlacePage/PlacePageViewController.swift b/iphone/Maps/UI/PlacePage/PlacePageViewController.swift index ad642e1f6..a2750209a 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageViewController.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageViewController.swift @@ -58,13 +58,6 @@ final class PlacePageScrollView: UIScrollView { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() - if #available(iOS 13.0, *) { - // See https://github.com/organicmaps/organicmaps/issues/6917 for the details. - } else if previousTraitCollection == nil { - scrollView.contentInset = alternativeSizeClass(iPhone: UIEdgeInsets(top: scrollView.height, left: 0, bottom: 0, right: 0), - iPad: UIEdgeInsets.zero) - updateSteps() - } panGesture.isEnabled = alternativeSizeClass(iPhone: false, iPad: true) previousTraitCollection = traitCollection } @@ -170,8 +163,7 @@ final class PlacePageScrollView: UIScrollView { actionBarContainerView.layer.setCornerRadius(.modalSheet, maskedCorners: cornersToMask) actionBarContainerView.layer.masksToBounds = true - // See https://github.com/organicmaps/organicmaps/issues/6917 for the details. - if #available(iOS 13.0, *), previousTraitCollection == nil { + if previousTraitCollection == nil { scrollView.contentInset = alternativeSizeClass(iPhone: UIEdgeInsets(top: view.height, left: 0, bottom: 0, right: 0), iPad: UIEdgeInsets.zero) scrollView.layoutIfNeeded() diff --git a/iphone/Maps/UI/Search/SearchOnMap/PlaceholderView.swift b/iphone/Maps/UI/Search/SearchOnMap/PlaceholderView.swift index d8a44a304..0568c76b0 100644 --- a/iphone/Maps/UI/Search/SearchOnMap/PlaceholderView.swift +++ b/iphone/Maps/UI/Search/SearchOnMap/PlaceholderView.swift @@ -61,11 +61,7 @@ final class PlaceholderView: UIView { if let activityIndicator = activityIndicator { activityIndicator.hidesWhenStopped = true activityIndicator.startAnimating() - if #available(iOS 13.0, *) { - activityIndicator.style = .medium - } else { - activityIndicator.style = .gray - } + activityIndicator.style = .medium } titleLabel.text = title diff --git a/iphone/Maps/UI/Search/SearchOnMap/SearchOnMapHeaderView.swift b/iphone/Maps/UI/Search/SearchOnMap/SearchOnMapHeaderView.swift index 5f006045b..de11d0772 100644 --- a/iphone/Maps/UI/Search/SearchOnMap/SearchOnMapHeaderView.swift +++ b/iphone/Maps/UI/Search/SearchOnMap/SearchOnMapHeaderView.swift @@ -65,11 +65,9 @@ final class SearchOnMapHeaderView: UIView { searchBar.setStyle(.defaultSearchBar) searchBar.placeholder = L("search") searchBar.showsCancelButton = false - if #available(iOS 13.0, *) { - searchBar.searchTextField.clearButtonMode = .always - searchBar.returnKeyType = .search - searchBar.searchTextField.enablesReturnKeyAutomatically = true - } + searchBar.searchTextField.clearButtonMode = .always + searchBar.returnKeyType = .search + searchBar.searchTextField.enablesReturnKeyAutomatically = true } private func setupCancelButton() { diff --git a/iphone/Maps/UI/Search/SearchOnMap/SearchOnMapViewController.swift b/iphone/Maps/UI/Search/SearchOnMap/SearchOnMapViewController.swift index f524f2d61..ff223501a 100644 --- a/iphone/Maps/UI/Search/SearchOnMap/SearchOnMapViewController.swift +++ b/iphone/Maps/UI/Search/SearchOnMap/SearchOnMapViewController.swift @@ -99,7 +99,7 @@ final class SearchOnMapViewController: UIViewController { override func viewWillTransition(to size: CGSize, with coordinator: any UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) - if #available(iOS 14.0, *), ProcessInfo.processInfo.isiOSAppOnMac { + if ProcessInfo.processInfo.isiOSAppOnMac { updateFrameOfPresentedViewInContainerView() } }