Some general text improvements

This commit is contained in:
Bas Broek
2017-10-22 22:49:52 +02:00
parent a0f1bcdfcb
commit 359794debf
5 changed files with 11 additions and 9 deletions

View File

@@ -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

View File

@@ -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) {

View File

@@ -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)

View File

@@ -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

View File

@@ -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: "")
}
}