From 19881427c9d1e15077e82fea8248b67e5a8db67f Mon Sep 17 00:00:00 2001 From: Phil Viso Date: Fri, 24 May 2019 09:56:26 -0500 Subject: [PATCH 1/5] Fixed a crash that occurs when presenting the share sheet on iPad. Issue #639 --- iOS/Detail/DetailViewController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/iOS/Detail/DetailViewController.swift b/iOS/Detail/DetailViewController.swift index f60c8f5e3..36dedcebf 100644 --- a/iOS/Detail/DetailViewController.swift +++ b/iOS/Detail/DetailViewController.swift @@ -168,6 +168,8 @@ class DetailViewController: UIViewController { } let itemSource = ArticleActivityItemSource(url: url, subject: navState?.currentArticle?.title) let activityViewController = UIActivityViewController(activityItems: [itemSource], applicationActivities: nil) + activityViewController.popoverPresentationController?.barButtonItem = self.actionBarButtonItem + present(activityViewController, animated: true) } From bae17df0e902f3b2044e31bf7d358a9d8b6c459e Mon Sep 17 00:00:00 2001 From: Phil Viso Date: Fri, 24 May 2019 10:07:17 -0500 Subject: [PATCH 2/5] Use modal presentation for add account view controllers --- iOS/Settings/AddAccountViewController.swift | 17 ++--- .../AddLocalAccountViewController.swift | 7 +- .../FeedbinAccountViewController.swift | 15 ++-- iOS/Settings/Settings.storyboard | 71 +++++++++++++++---- 4 files changed, 82 insertions(+), 28 deletions(-) diff --git a/iOS/Settings/AddAccountViewController.swift b/iOS/Settings/AddAccountViewController.swift index 04e7eda5e..eb78d8174 100644 --- a/iOS/Settings/AddAccountViewController.swift +++ b/iOS/Settings/AddAccountViewController.swift @@ -10,7 +10,7 @@ import Account import UIKit protocol AddAccountDismissDelegate: UIViewController { - func dismiss() + func dismiss(_ viewController: UIViewController) } class AddAccountViewController: UITableViewController, AddAccountDismissDelegate { @@ -24,23 +24,24 @@ class AddAccountViewController: UITableViewController, AddAccountDismissDelegate } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let storyboard = UIStoryboard.settings switch indexPath.row { case 0: - let addViewController = storyboard.instantiateViewController(withIdentifier: "AddLocalAccountViewController") as! AddLocalAccountViewController + let navController = UIStoryboard.settings.instantiateViewController(withIdentifier: "AddLocalAccountNavigationViewController") as! UINavigationController + let addViewController = navController.topViewController as! AddLocalAccountViewController addViewController.delegate = self - navigationController?.pushViewController(addViewController, animated: true) + present(navController, animated: true) case 1: - let addViewController = storyboard.instantiateViewController(withIdentifier: "FeedbinAccountViewController") as! FeedbinAccountViewController + let navController = UIStoryboard.settings.instantiateViewController(withIdentifier: "FeedbinAccountNavigationViewController") as! UINavigationController + let addViewController = navController.topViewController as! FeedbinAccountViewController addViewController.delegate = self - navigationController?.pushViewController(addViewController, animated: true) + present(navController, animated: true) default: break } } - func dismiss() { - navigationController?.popToRootViewController(animated: true) + func dismiss(_ viewController: UIViewController) { + viewController.dismiss(animated: true, completion: nil) } } diff --git a/iOS/Settings/AddLocalAccountViewController.swift b/iOS/Settings/AddLocalAccountViewController.swift index 1ace24fb4..efa58085d 100644 --- a/iOS/Settings/AddLocalAccountViewController.swift +++ b/iOS/Settings/AddLocalAccountViewController.swift @@ -11,6 +11,7 @@ import Account class AddLocalAccountViewController: UIViewController { + @IBOutlet weak var cancelBarButtonItem: UIBarButtonItem! @IBOutlet private weak var localAccountNameLabel: UILabel! @IBOutlet weak var nameTextField: UITextField! @@ -23,10 +24,14 @@ class AddLocalAccountViewController: UIViewController { nameTextField.delegate = self } + @IBAction func cancel(_ sender: Any) { + delegate?.dismiss(self) + } + @IBAction func addAccountTapped(_ sender: Any) { let account = AccountManager.shared.createAccount(type: .onMyMac) account.name = nameTextField.text - delegate?.dismiss() + delegate?.dismiss(self) } } diff --git a/iOS/Settings/FeedbinAccountViewController.swift b/iOS/Settings/FeedbinAccountViewController.swift index cc5d2fdab..69c19c43e 100644 --- a/iOS/Settings/FeedbinAccountViewController.swift +++ b/iOS/Settings/FeedbinAccountViewController.swift @@ -13,7 +13,7 @@ import RSWeb class FeedbinAccountViewController: UIViewController { @IBOutlet weak var activityIndicator: UIActivityIndicatorView! - + @IBOutlet weak var cancelBarButtonItem: UIBarButtonItem! @IBOutlet weak var emailTextField: UITextField! @IBOutlet weak var passwordTextField: UITextField! @IBOutlet weak var addAccountButton: UIButton! @@ -38,6 +38,10 @@ class FeedbinAccountViewController: UIViewController { } } + @IBAction func cancel(_ sender: Any) { + delegate?.dismiss(self) + } + @IBAction func addAccountTapped(_ sender: Any) { self.errorMessageLabel.text = nil @@ -74,7 +78,7 @@ class FeedbinAccountViewController: UIViewController { self.account?.refreshAll() } - self.delegate?.dismiss() + self.delegate?.dismiss(self) } catch { self.errorMessageLabel.text = NSLocalizedString("Keychain error while storing credentials.", comment: "Credentials Error") } @@ -89,13 +93,12 @@ class FeedbinAccountViewController: UIViewController { } private func enableNavigation() { - self.navigationItem.backBarButtonItem?.isEnabled = true + self.cancelBarButtonItem.isEnabled = true self.addAccountButton.isEnabled = true - self.activityIndicator.isHidden = true } private func disableNavigation() { - navigationItem.backBarButtonItem?.isEnabled = false + cancelBarButtonItem.isEnabled = false addAccountButton.isEnabled = false } @@ -108,7 +111,7 @@ class FeedbinAccountViewController: UIViewController { self.activityIndicator.isHidden = true self.activityIndicator.stopAnimating() } - + } extension FeedbinAccountViewController: UITextFieldDelegate { diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 6ad64c7f2..5d478eaa6 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -508,6 +508,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -517,10 +549,10 @@ - + - + @@ -536,7 +568,7 @@ - + @@ -545,7 +577,7 @@ - + From 08310aacc9311b126fa77e9d085c6b97f2d3abf1 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sat, 25 May 2019 14:49:34 -0500 Subject: [PATCH 3/5] Reformat add scene so that it looks like the Settings app add scene. --- iOS/Settings/Settings.storyboard | 92 +++++++++++++++++--------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 5d478eaa6..f3562e076 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -430,67 +430,73 @@ - + - + - - - - - - - - - + + + + + + + + + + + + + + - - - - + + - + - + - + - - - - - - - - - + + + + + + + + + + + + + + - - - - + + - + @@ -552,7 +558,7 @@ - + From 202b7ff5f4c44034499be8eec3833d64da0547b0 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sat, 25 May 2019 14:52:31 -0500 Subject: [PATCH 4/5] Remove App Camp for Girls donation link. --- iOS/Settings/Settings.storyboard | 35 +++++------------------ iOS/Settings/SettingsViewController.swift | 4 +-- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index f3562e076..25dc9cd27 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -146,31 +146,10 @@ - - - - - - - - - - - - - - - - + @@ -200,7 +179,7 @@ - + @@ -228,7 +207,7 @@ - + @@ -252,7 +231,7 @@ - + @@ -269,7 +248,7 @@ - + @@ -441,7 +420,7 @@ - + @@ -558,7 +537,7 @@ - + diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index f395d62d1..52c7da5f7 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -131,13 +131,11 @@ class SettingsViewController: UITableViewController { UIApplication.shared.open(URL(string: "https://ranchero.com/netnewswire/")!, options: [:]) } case 2: - UIApplication.shared.open(URL(string: "https://appcamp4girls.com/contribute/")!, options: [:]) - case 3: if indexPath.row == 1 { let timeline = UIStoryboard.settings.instantiateController(ofType: TimelineNumberOfLinesViewController.self) self.navigationController?.pushViewController(timeline, animated: true) } - case 4: + case 3: switch indexPath.row { case 0: let timeline = UIStoryboard.settings.instantiateController(ofType: RefreshIntervalViewController.self) From 256b80568497aebde2cdeb8512ce5c20f34d664e Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Sat, 25 May 2019 16:04:48 -0500 Subject: [PATCH 5/5] Set email text field content type to username so iOS offers to autofill passwords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is what Apple says to do for email fields. https://developer.apple.com/documentation/security/password_autofill/enabling_password_autofill_on_a_text_input_view > For example, if your site uses email addresses as user names, set the input view’s textContentType property to .username, and set the keyboardType property to .UIKeyboardType.emailAddress. --- iOS/Settings/Settings.storyboard | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS/Settings/Settings.storyboard b/iOS/Settings/Settings.storyboard index 25dc9cd27..462b663f1 100644 --- a/iOS/Settings/Settings.storyboard +++ b/iOS/Settings/Settings.storyboard @@ -640,7 +640,7 @@ - +