do Conversations & Contacts

This commit is contained in:
nixzhu
2015-11-02 11:08:30 +08:00
parent 3251158819
commit 70d40d736f
2 changed files with 11 additions and 3 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ import UIKit
extension UITableView {
var yep_isAtTop: Bool {
println("contentOffset.y: \(contentOffset.y), -contentInset.top: \(-contentInset.top)")
return contentOffset.y == -contentInset.top
}
@@ -98,10 +98,18 @@ extension YepTabBarController: UITabBarControllerDelegate {
switch tab {
case .Conversations:
let vc = nvc.topViewController as? ConversationsViewController
if let vc = nvc.topViewController as? ConversationsViewController {
if !vc.conversationsTableView.yep_isAtTop {
vc.conversationsTableView.yep_scrollsToTop()
}
}
case .Contacts:
let vc = nvc.topViewController as? ContactsViewController
if let vc = nvc.topViewController as? ContactsViewController {
if !vc.contactsTableView.yep_isAtTop {
vc.contactsTableView.yep_scrollsToTop()
}
}
case .Feeds:
if let vc = nvc.topViewController as? FeedsViewController {