Просмотр исходного кода

removed line that caused dc_configure to jump to chat tab

Bastian van de Wetering 6 лет назад
Родитель
Сommit
f060622de5
2 измененных файлов с 14 добавлено и 3 удалено
  1. 13 2
      deltachat-ios/Coordinator/AppCoordinator.swift
  2. 1 1
      deltachat-ios/DC/events.swift

+ 13 - 2
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -96,17 +96,28 @@ class AppCoordinator: NSObject, Coordinator, UITabBarControllerDelegate {
     showTab(index: 3)
     showTab(index: 3)
   }
   }
 
 
-  public func showTab(index: Int) {
+  func showTab(index: Int) {
     tabBarController.selectedIndex = index
     tabBarController.selectedIndex = index
   }
   }
 
 
-  public func presentLoginController() {
+	func presentLoginController() {
     let accountSetupController = AccountSetupController()
     let accountSetupController = AccountSetupController()
     let accountSetupNavigationController = UINavigationController(rootViewController: accountSetupController)
     let accountSetupNavigationController = UINavigationController(rootViewController: accountSetupController)
     rootViewController.present(accountSetupNavigationController, animated: false, completion: nil)
     rootViewController.present(accountSetupNavigationController, animated: false, completion: nil)
   }
   }
 }
 }
 
 
+extension AppCoordinator: UITabBarDelegate {
+	func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) {
+		print("item selected")
+	}
+
+	func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
+		print("shouldSelect")
+		return true 
+	}
+}
+
 class ContactListCoordinator: Coordinator {
 class ContactListCoordinator: Coordinator {
   let navigationController: UINavigationController
   let navigationController: UINavigationController
 
 

+ 1 - 1
deltachat-ios/DC/events.swift

@@ -93,7 +93,7 @@ public func callbackSwift(event: CInt, data1: CUnsignedLong, data2: CUnsignedLon
         UserDefaults.standard.set(true, forKey: Constants.Keys.deltachatUserProvidedCredentialsKey)
         UserDefaults.standard.set(true, forKey: Constants.Keys.deltachatUserProvidedCredentialsKey)
         UserDefaults.standard.synchronize()
         UserDefaults.standard.synchronize()
         let appDelegate = UIApplication.shared.delegate as! AppDelegate
         let appDelegate = UIApplication.shared.delegate as! AppDelegate
-        appDelegate.appCoordinator?.showTab(index: 3)
+       // appDelegate.appCoordinator?.showTab(index: 3)
         AppDelegate.lastErrorDuringConfig = nil
         AppDelegate.lastErrorDuringConfig = nil
       }
       }
     }
     }