فهرست منبع

added coordinator to AccountSetupController

Bastian van de Wetering 6 سال پیش
والد
کامیت
6aeafd9cf2
2فایلهای تغییر یافته به همراه38 افزوده شده و 3 حذف شده
  1. 8 3
      deltachat-ios/Controller/AccountSetupController.swift
  2. 30 0
      deltachat-ios/Coordinator/AppCoordinator.swift

+ 8 - 3
deltachat-ios/Controller/AccountSetupController.swift

@@ -10,6 +10,9 @@ import SafariServices
 import UIKit
 
 class AccountSetupController: UITableViewController {
+
+	weak var coordinator: AccountSetupCoordinator?
+
   private var backupProgressObserver: Any?
   private var configureProgressObserver: Any?
   private var oauth2Observer: Any?
@@ -56,10 +59,12 @@ class AccountSetupController: UITableViewController {
     return cell
   }()
 
-  lazy var imapPortCell: TextFieldCell = {
-    let cell = TextFieldCell(description: "IMAP Port", placeholder: MRConfig.mailPort ?? MRConfig.configuredMailPort, delegate: self)
+  lazy var imapPortCell: UITableViewCell = {
+		let cell = UITableViewCell(style: .value1, reuseIdentifier: nil)
+		cell.textLabel?.text = "IMAP Port"
+		cell.accessoryType = .disclosureIndicator
+		cell.detailTextLabel?.text = MRConfig.mailPort ?? MRConfig.configuredMailPort
     cell.accessibilityIdentifier = "IMAPPortCell"
-    cell.textField.tag = 4
     return cell
   }()
 

+ 30 - 0
deltachat-ios/Coordinator/AppCoordinator.swift

@@ -180,12 +180,17 @@ class ChatListCoordinator: Coordinator {
 class SettingsCoordinator: Coordinator {
   let navigationController: UINavigationController
 
+	var childCoordinators:[Coordinator] = []
+
   init(navigationController: UINavigationController) {
     self.navigationController = navigationController
   }
 
   func showAccountSetupController() {
     let accountSetupVC = AccountSetupController()
+		let coordinator = AccountSetupCoordinator(navigationController: navigationController)
+		childCoordinators.append(coordinator)
+		accountSetupVC.coordinator = coordinator
     navigationController.pushViewController(accountSetupVC, animated: true)
   }
 
@@ -196,6 +201,31 @@ class SettingsCoordinator: Coordinator {
 	}
 }
 
+class AccountSetupCoordinator: Coordinator {
+	let navigationController: UINavigationController
+
+	init(navigationController: UINavigationController) {
+		self.navigationController = navigationController
+	}
+
+	func showImapPortOptions() {
+
+	}
+
+	func showImapSecurityOptions() {
+
+	}
+
+	func showSmtpPortsOptions() {
+
+	}
+
+	func showSmptpSecurityOptions() {
+
+	}
+
+}
+
 class NewChatCoordinator: Coordinator {
   let navigationController: UINavigationController