diff --git a/Classes/Bookmark/BookmarksViewController.swift b/Classes/Bookmark/BookmarksViewController.swift index 4efe8d43..0cdfd23f 100644 --- a/Classes/Bookmark/BookmarksViewController.swift +++ b/Classes/Bookmark/BookmarksViewController.swift @@ -37,7 +37,7 @@ TabNavRootViewControllerType { super.viewDidLoad() searchBar.delegate = self - searchBar.placeholder = NSLocalizedString(Constants.Strings.search, comment: "") + searchBar.placeholder = NSLocalizedString("\(Constants.Strings.search) \(Constants.Strings.bookmarks)", comment: "") searchBar.tintColor = Styles.Colors.Blue.medium.color searchBar.backgroundColor = .clear searchBar.searchBarStyle = .minimal diff --git a/Classes/Search/SearchViewController.swift b/Classes/Search/SearchViewController.swift index 343faf93..4fbd9446 100644 --- a/Classes/Search/SearchViewController.swift +++ b/Classes/Search/SearchViewController.swift @@ -52,11 +52,6 @@ SearchResultSectionControllerDelegate { init(client: GithubClient) { self.client = client super.init(nibName: nil, bundle: nil) - NotificationCenter.default - .addObserver(searchBar, - selector: #selector(UISearchBar.resignFirstResponder), - name: .UIKeyboardWillHide, - object: nil) } required init?(coder aDecoder: NSCoder) { @@ -92,6 +87,12 @@ SearchResultSectionControllerDelegate { name: .UIKeyboardWillHide, object: nil ) + + nc.addObserver( + searchBar, + selector: #selector(UISearchBar.resignFirstResponder), + name: .UIKeyboardWillHide, + object: nil) } override func viewWillAppear(_ animated: Bool) { diff --git a/Classes/Systems/ShortcutHandler.swift b/Classes/Systems/ShortcutHandler.swift index 6a0615f8..8b8091a0 100644 --- a/Classes/Systems/ShortcutHandler.swift +++ b/Classes/Systems/ShortcutHandler.swift @@ -42,10 +42,10 @@ struct ShortcutHandler { var items: [UIApplicationShortcutItem] = [] // Search - let searchIcon = UIApplicationShortcutIcon(templateImageName: "search") + let searchIcon = UIApplicationShortcutIcon(templateImageName: Items.search.rawValue) let searchItem = UIApplicationShortcutItem(type: Items.search.rawValue, localizedTitle: Constants.Strings.search, - localizedSubtitle: nil, + localizedSubtitle: NSLocalizedString("Search GitHub", comment: ""), icon: searchIcon, userInfo: nil) items.append(searchItem) diff --git a/Classes/View Controllers/RootViewControllers.swift b/Classes/View Controllers/RootViewControllers.swift index c497902e..28130799 100644 --- a/Classes/View Controllers/RootViewControllers.swift +++ b/Classes/View Controllers/RootViewControllers.swift @@ -50,7 +50,7 @@ func newSearchRootViewController(client: GithubClient) -> UIViewController { } func newBookmarksRootViewController(client: GithubClient) -> UIViewController { - let title = NSLocalizedString("Bookmarks", comment: "") + let title = Constants.Strings.bookmarks let controller = BookmarksViewController(client: client) controller.makeBackBarItemEmpty() controller.title = title diff --git a/Classes/Views/Constants.swift b/Classes/Views/Constants.swift index 9ab449cf..91e83eb2 100644 --- a/Classes/Views/Constants.swift +++ b/Classes/Views/Constants.swift @@ -41,5 +41,6 @@ enum Constants { static let delete = NSLocalizedString("Delete", comment: "") static let inbox = NSLocalizedString("Inbox", comment: "") static let upload = NSLocalizedString("Upload", comment: "") + static let bookmarks = NSLocalizedString("Bookmarks", comment: "") } }