From d1684a1c69064239da314a0460134dc0f9cb19f0 Mon Sep 17 00:00:00 2001 From: Phil Viso Date: Wed, 22 May 2019 20:29:00 -0500 Subject: [PATCH] Improved the UI of adding a new local account --- iOS/Settings/AddAccountViewController.swift | 6 +-- .../AddLocalAccountViewController.swift | 7 +-- iOS/Settings/Settings.storyboard | 47 +++++++++++-------- 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/iOS/Settings/AddAccountViewController.swift b/iOS/Settings/AddAccountViewController.swift index c4e7a6285..8261db2b5 100644 --- a/iOS/Settings/AddAccountViewController.swift +++ b/iOS/Settings/AddAccountViewController.swift @@ -29,19 +29,19 @@ class AddAccountViewController: UITableViewController, AddAccountDismissDelegate let navController = UIStoryboard.settings.instantiateViewController(withIdentifier: "AddLocalAccountNavigationViewController") as! UINavigationController let addViewController = navController.topViewController as! AddLocalAccountViewController addViewController.delegate = self - present(navController, animated: true) + navigationController?.pushViewController(addViewController, animated: true) case 1: let navController = UIStoryboard.settings.instantiateViewController(withIdentifier: "FeedbinAccountNavigationViewController") as! UINavigationController let addViewController = navController.topViewController as! FeedbinAccountViewController addViewController.delegate = self - present(navController, animated: true) + navigationController?.pushViewController(addViewController, animated: true) default: break } } func dismiss() { - navigationController?.popViewController(animated: false) + navigationController?.popToRootViewController(animated: true) } } diff --git a/iOS/Settings/AddLocalAccountViewController.swift b/iOS/Settings/AddLocalAccountViewController.swift index 6973a48d8..1ace24fb4 100644 --- a/iOS/Settings/AddLocalAccountViewController.swift +++ b/iOS/Settings/AddLocalAccountViewController.swift @@ -23,14 +23,9 @@ class AddLocalAccountViewController: UIViewController { nameTextField.delegate = self } - @IBAction func cancel(_ sender: Any) { - dismiss(animated: true) - } - - @IBAction func done(_ sender: Any) { + @IBAction func addAccountTapped(_ sender: Any) { let account = AccountManager.shared.createAccount(type: .onMyMac) account.name = nameTextField.text - dismiss(animated: true) delegate?.dismiss() } diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 714c3f4aa..f5bbf677b 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -337,7 +337,7 @@ - + @@ -517,7 +517,7 @@ - + @@ -535,37 +535,44 @@ - - + + - + + - + - + + + + + + + - + - - - - - - - - - - - - +