From 0400c59d54a0661727243eca84f9544832e39855 Mon Sep 17 00:00:00 2001 From: Ioan Moldovan Date: Thu, 25 Dec 2025 15:57:28 -0800 Subject: [PATCH] add ios 26 compatibility --- .../Controllers/Search/SearchViewController.swift | 3 ++- FlowCrypt/Info.plist | 2 -- FlowCryptUI/Views/NavigationBarActionButton.swift | 15 +++++---------- FlowCryptUI/Views/NavigationBarItemsView.swift | 13 +++++++++---- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/FlowCrypt/Controllers/Search/SearchViewController.swift b/FlowCrypt/Controllers/Search/SearchViewController.swift index 0817eeebd..59d91ef8e 100644 --- a/FlowCrypt/Controllers/Search/SearchViewController.swift +++ b/FlowCrypt/Controllers/Search/SearchViewController.swift @@ -38,7 +38,8 @@ class SearchViewController: InboxViewController { override func setupNavigationBar() { title = "search_title".localized - navigationItem.titleView = searchController.searchBar + navigationItem.searchController = searchController + navigationItem.hidesSearchBarWhenScrolling = false navigationItem.rightBarButtonItems = nil navigationItem.leftBarButtonItem = .defaultBackButton { self.navigationController?.popViewController(animated: true) diff --git a/FlowCrypt/Info.plist b/FlowCrypt/Info.plist index fcb9898e2..8907b4276 100644 --- a/FlowCrypt/Info.plist +++ b/FlowCrypt/Info.plist @@ -2,8 +2,6 @@ - UIDesignRequiresCompatibility - CFBundleDevelopmentRegion en CFBundleDisplayName diff --git a/FlowCryptUI/Views/NavigationBarActionButton.swift b/FlowCryptUI/Views/NavigationBarActionButton.swift index 4ad781e96..67ab0843b 100644 --- a/FlowCryptUI/Views/NavigationBarActionButton.swift +++ b/FlowCryptUI/Views/NavigationBarActionButton.swift @@ -16,16 +16,11 @@ public final class NavigationBarActionButton: UIBarButtonItem { private var onAction: (() -> Void)? public convenience init(imageSystemName: String, action: (() -> Void)?, accessibilityIdentifier: String? = nil) { - self.init() - onAction = action - customView = UIButton(type: .system).with { - $0.contentHorizontalAlignment = .left - $0.setImage(UIImage(systemName: imageSystemName), for: .normal) - $0.frame.size = Constants.buttonSize - $0.addTarget(self, action: #selector(tap), for: .touchUpInside) - $0.accessibilityIdentifier = accessibilityIdentifier - $0.isAccessibilityElement = true - } + self.init(image: UIImage(systemName: imageSystemName), style: .plain, target: nil, action: nil) + self.target = self + self.action = #selector(tap) + self.accessibilityIdentifier = accessibilityIdentifier + self.onAction = action } @objc private func tap() { diff --git a/FlowCryptUI/Views/NavigationBarItemsView.swift b/FlowCryptUI/Views/NavigationBarItemsView.swift index f720380e4..6d58648d7 100644 --- a/FlowCryptUI/Views/NavigationBarItemsView.swift +++ b/FlowCryptUI/Views/NavigationBarItemsView.swift @@ -43,12 +43,17 @@ public final class NavigationBarItemsView: UIBarButtonItem { let buttons = input.enumerated() .map { value in - UIButton(type: .system).then { + UIButton(configuration: .plain()).then { $0.tag = value.offset + $0.configuration?.image = value.element.image + $0.configuration?.title = value.element.title + $0.configuration?.baseForegroundColor = .white + $0.configuration?.contentInsets = .zero + $0.frame.size = Constants.buttonSize - $0.imageView?.frame.size = Constants.buttonSize - $0.setImage(value.element.image, for: .normal) - $0.setTitle(value.element.title, for: .normal) + // Ensure image scales correctly within the configuration + $0.imageView?.contentMode = .scaleAspectFit + $0.accessibilityIdentifier = value.element.accessibilityId $0.isAccessibilityElement = true $0.addTarget(self, action: #selector(self.handleTap(with:)), for: .touchUpInside)