Skip to content

Commit

Permalink
Refactor: search button no longer needs to be spotlightable
Browse files Browse the repository at this point in the history
  • Loading branch information
Momo Ozawa committed Apr 27, 2022
1 parent 0177e78 commit 248ece3
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class ReaderTabViewController: UIViewController {
}()

private let settingsButton: SpotlightableButton = SpotlightableButton(type: .custom)
private let searchButton: SpotlightableButton = SpotlightableButton(type: .custom)

init(viewModel: ReaderTabViewModel, readerTabViewFactory: @escaping (ReaderTabViewModel) -> ReaderTabView) {
self.viewModel = viewModel
Expand Down Expand Up @@ -81,22 +80,21 @@ class ReaderTabViewController: UIViewController {
}

func setupNavigationButtons() {
// Search Button
let searchButton = UIBarButtonItem(image: UIImage.gridicon(.search),
style: .plain,
target: self,
action: #selector(didTapSearchButton))
searchButton.accessibilityIdentifier = ReaderTabConstants.searchButtonAccessibilityIdentifier

// Settings Button
settingsButton.spotlightOffset = ReaderTabConstants.spotlightOffset
settingsButton.setImage(.gridicon(.cog), for: .normal)
settingsButton.addTarget(self, action: #selector(didTapSettingsButton), for: .touchUpInside)
settingsButton.accessibilityIdentifier = ReaderTabConstants.settingsButtonIdentifier

// Search Button
searchButton.spotlightOffset = ReaderTabConstants.spotlightOffset
searchButton.setImage(.gridicon(.search), for: .normal)
searchButton.addTarget(self, action: #selector(didTapSearchButton), for: .touchUpInside)
searchButton.accessibilityIdentifier = ReaderTabConstants.searchButtonAccessibilityIdentifier

let settingsButton = UIBarButtonItem(customView: settingsButton)
let searchBarButton = UIBarButtonItem(customView: searchButton)

navigationItem.rightBarButtonItems = [searchBarButton, settingsButton]
navigationItem.rightBarButtonItems = [searchButton, settingsButton]
}

override func loadView() {
Expand Down

0 comments on commit 248ece3

Please sign in to comment.