Skip to content

Commit

Permalink
noTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
nixzhu committed Jun 6, 2016
1 parent e325bd1 commit 9bfafef
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Yep/ViewControllers/Contacts/ContactsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ final class ContactsViewController: BaseViewController {
override func viewDidLoad() {
super.viewDidLoad()

title = NSLocalizedString("Contacts", comment: "")
navigationItem.title = NSLocalizedString("Contacts", comment: "")

NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ContactsViewController.syncFriendships(_:)), name: FriendsInContactsViewController.Notification.NewFriends, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(ContactsViewController.deactiveSearchController(_:)), name: YepConfig.Notification.switchedToOthersFromContactsTab, object: nil)
Expand Down
2 changes: 1 addition & 1 deletion Yep/ViewControllers/Feeds/FeedsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ final class FeedsViewController: BaseViewController {
}
}

title = NSLocalizedString("Feeds", comment: "")
navigationItem.title = NSLocalizedString("Feeds", comment: "")

searchBar.placeholder = NSLocalizedString("Search Feeds", comment: "")

Expand Down
2 changes: 1 addition & 1 deletion Yep/ViewControllers/Profile/ProfileViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ final class ProfileViewController: SegueViewController {
}
})

title = NSLocalizedString("Profile", comment: "")
navigationItem.title = NSLocalizedString("Profile", comment: "")

view.addSubview(customNavigationBar)

Expand Down
30 changes: 16 additions & 14 deletions Yep/ViewControllers/TabBar/YepTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,24 @@ final class YepTabBarController: UITabBarController {

func setTabBarItems() {

// 将 UITabBarItem 的 image 下移一些,也不显示 title 了
/*
if let items = tabBar.items as? [UITabBarItem] {
for item in items {
item.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0)
item.title = nil
let noTitle = true

if noTitle {
// 将 UITabBarItem 的 image 下移一些,也不显示 title 了
if let items = tabBar.items {
for item in items {
item.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0)
item.title = nil
}
}
}
*/

// Set Titles

if let items = tabBar.items {
for i in 0..<items.count {
let item = items[i]
item.title = Tab(rawValue: i)?.title
} else {
// Set Titles
if let items = tabBar.items {
for i in 0..<items.count {
let item = items[i]
item.title = Tab(rawValue: i)?.title
}
}
}
}
Expand Down

0 comments on commit 9bfafef

Please sign in to comment.