diff --git a/TwoFAS/TwoFASWatch Watch App/Settings/SortTokens/SortTokensPresenter.swift b/TwoFAS/TwoFASWatch Watch App/Settings/SortTokens/SortTokensPresenter.swift index f0fe35e8..ee8309d3 100644 --- a/TwoFAS/TwoFASWatch Watch App/Settings/SortTokens/SortTokensPresenter.swift +++ b/TwoFAS/TwoFASWatch Watch App/Settings/SortTokens/SortTokensPresenter.swift @@ -51,27 +51,3 @@ final class SortTokensPresenter: SortTokensPresenting { currentSortType = sortType } } - -extension SortType { - var localized: String { - switch self { - case .az: return T.Tokens.sortByAToZ - case .za: return T.Tokens.sortByZToA - case .manual: return T.Tokens.sortByManual - } - } - - func image(forSelectedOption option: Self, configuration: UIImage.SymbolConfiguration) -> UIImage { - var image: UIImage? - switch self { - case .az: image = UIImage(systemName: "arrow.down") - case .za: image = UIImage(systemName: "arrow.up") - case .manual: image = UIImage(systemName: "line.3.horizontal") - } - - if self == option { - image = image?.withConfiguration(configuration) - } - return image?.withRenderingMode(.alwaysTemplate) ?? UIImage() - } -} diff --git a/TwoFAS/TwoFASWatch Watch App/Settings/SortTokens/SortTokensView.swift b/TwoFAS/TwoFASWatch Watch App/Settings/SortTokens/SortTokensView.swift index c5bc5076..ebaa1e68 100644 --- a/TwoFAS/TwoFASWatch Watch App/Settings/SortTokens/SortTokensView.swift +++ b/TwoFAS/TwoFASWatch Watch App/Settings/SortTokens/SortTokensView.swift @@ -71,6 +71,30 @@ struct SortTokensView: View { } } +extension SortType { + var localized: String { + switch self { + case .az: return T.Tokens.sortByAToZ + case .za: return T.Tokens.sortByZToA + case .manual: return T.Tokens.sortByManual + } + } + + func image(forSelectedOption option: Self, configuration: UIImage.SymbolConfiguration) -> UIImage { + var image: UIImage? + switch self { + case .az: image = UIImage(systemName: "arrow.down") + case .za: image = UIImage(systemName: "arrow.up") + case .manual: image = UIImage(systemName: "line.3.horizontal") + } + + if self == option { + image = image?.withConfiguration(configuration) + } + return image?.withRenderingMode(.alwaysTemplate) ?? UIImage() + } +} + #Preview { final class SortTokensPresenterMock: SortTokensPresenting { var currentSortType: CommonWatch.SortType = .manual