mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-06-02 14:39:05 +08:00
Some general text improvements
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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: "")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user