浏览代码

rename view controllers back button stacked on top of ChatListViewController to 'Chats'

cyberta 4 年之前
父节点
当前提交
8d8b4b8c1c
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      deltachat-ios/Controller/ChatListController.swift

+ 10 - 2
deltachat-ios/Controller/ChatListController.swift

@@ -169,6 +169,9 @@ class ChatListController: UITableViewController {
     // MARK: - setup
     private func setupSubviews() {
         emptySearchStateLabel.addCenteredTo(parentView: view)
+        let backButton = UIBarButtonItem()
+        backButton.title = String.localized("pref_chats")
+        navigationItem.backBarButtonItem = backButton
     }
 
     @objc
@@ -178,8 +181,6 @@ class ChatListController: UITableViewController {
         navigationController?.pushViewController(connectivityViewController, animated: true)
     }
 
-    
-
     // MARK: - configuration
     private func configureTableView() {
         tableView.register(ContactCell.self, forCellReuseIdentifier: chatCellReuseIdentifier)
@@ -378,11 +379,18 @@ class ChatListController: UITableViewController {
         } else if viewModel.isArchive {
             titleView.text = String.localized("chat_archived_chats_title")
             navigationItem.setLeftBarButton(nil, animated: true)
+           
         } else {
             titleView.text = DcUtils.getConnectivityString(dcContext: dcContext, connectedString: String.localized("app_name"))
             navigationItem.setLeftBarButton(nil, animated: true)
         }
         titleView.sizeToFit()
+        
+        /**
+         let backItem = UIBarButtonItem()
+             backItem.title = "Something Else"
+         */
+        
     }
 
     func handleChatListUpdate() {