From 05384c581f55698b0be64f0b3b0764e98a540c1e Mon Sep 17 00:00:00 2001 From: Balazs Perlaki-Horvath Date: Sun, 17 Dec 2023 15:12:46 +0100 Subject: [PATCH] Fixlint --- App/CompactViewController.swift | 9 +++++++-- Model/Utilities/String+Extension.swift | 25 +++++++++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/App/CompactViewController.swift b/App/CompactViewController.swift index d25525c0..0feba42e 100644 --- a/App/CompactViewController.swift +++ b/App/CompactViewController.swift @@ -71,8 +71,13 @@ final class CompactViewController: UIHostingController, UISearchControl func willPresentSearchController(_ searchController: UISearchController) { navigationController?.setToolbarHidden(true, animated: true) navigationItem.setRightBarButton( - UIBarButtonItem(title: "common.button.cancel".localized, style: .done, target: self, action: #selector(onSearchCancelled)) - , animated: true + UIBarButtonItem( + title: "common.button.cancel".localized, + style: .done, + target: self, + action: #selector(onSearchCancelled) + ), + animated: true ) } @objc func onSearchCancelled() { diff --git a/Model/Utilities/String+Extension.swift b/Model/Utilities/String+Extension.swift index ef882e8a..7c07e21c 100644 --- a/Model/Utilities/String+Extension.swift +++ b/Model/Utilities/String+Extension.swift @@ -11,15 +11,33 @@ import Foundation extension String { var localized: String { - return NSLocalizedString(self, tableName: nil, bundle: DefaultLanguages.currentBundle, value: "", comment: "") + NSLocalizedString( + self, + tableName: nil, + bundle: DefaultLanguages.currentBundle, + value: "", + comment: "" + ) } func localized(withComment: String) -> String { - return NSLocalizedString(self, tableName: nil, bundle: DefaultLanguages.currentBundle, value: "", comment: withComment) + return NSLocalizedString( + self, + tableName: nil, + bundle: DefaultLanguages.currentBundle, + value: "", + comment: withComment + ) } func localizedWithFormat(withArgs: CVarArg...) -> String { - let format = NSLocalizedString(self, tableName: nil, bundle: DefaultLanguages.currentBundle, value: "", comment: "") + let format = NSLocalizedString( + self, + tableName: nil, + bundle: DefaultLanguages.currentBundle, + value: "", + comment: "" + ) switch withArgs.count { case 1: return String.localizedStringWithFormat(format, withArgs[0]) @@ -27,5 +45,4 @@ extension String { default: return String.localizedStringWithFormat(format, withArgs) } } - }