diff --git a/Mac/Preferences/Accounts/AccountsFeedWranglerWindowController.swift b/Mac/Preferences/Accounts/AccountsFeedWranglerWindowController.swift index c17ff705a..d7d185c9d 100644 --- a/Mac/Preferences/Accounts/AccountsFeedWranglerWindowController.swift +++ b/Mac/Preferences/Accounts/AccountsFeedWranglerWindowController.swift @@ -41,7 +41,7 @@ class AccountsFeedWranglerWindowController: NSWindowController { actionButton.title = NSLocalizedString("Create", comment: "Create") signInTextField.stringValue = NSLocalizedString("Sign in to your Feed Wrangler account.", comment: "SignIn") } - + enableAutofill() usernameTextField.becomeFirstResponder() } @@ -126,4 +126,12 @@ class AccountsFeedWranglerWindowController: NSWindowController { NSWorkspace.shared.open(URL(string: "https://feedwrangler.net/users/new")!) } + // MARK: Autofill + func enableAutofill() { + if #available(macOS 11, *) { + usernameTextField.contentType = .username + passwordTextField.contentType = .password + } + } + } diff --git a/Mac/Preferences/Accounts/AccountsFeedbinWindowController.swift b/Mac/Preferences/Accounts/AccountsFeedbinWindowController.swift index 2dbba5b3c..444e152d0 100644 --- a/Mac/Preferences/Accounts/AccountsFeedbinWindowController.swift +++ b/Mac/Preferences/Accounts/AccountsFeedbinWindowController.swift @@ -41,7 +41,9 @@ class AccountsFeedbinWindowController: NSWindowController { actionButton.title = NSLocalizedString("Create", comment: "Add Account") signInTextField.stringValue = NSLocalizedString("Sign in to your Feedbin account.", comment: "SignIn") } - + + enableAutofill() + usernameTextField.becomeFirstResponder() } @@ -129,5 +131,12 @@ class AccountsFeedbinWindowController: NSWindowController { NSWorkspace.shared.open(URL(string: "https://feedbin.com/signup")!) } - + // MARK: Autofill + func enableAutofill() { + if #available(macOS 11, *) { + usernameTextField.contentType = .username + passwordTextField.contentType = .password + } + } + } diff --git a/Mac/Preferences/Accounts/AccountsNewsBlurWindowController.swift b/Mac/Preferences/Accounts/AccountsNewsBlurWindowController.swift index 0060bca95..00f47778e 100644 --- a/Mac/Preferences/Accounts/AccountsNewsBlurWindowController.swift +++ b/Mac/Preferences/Accounts/AccountsNewsBlurWindowController.swift @@ -41,7 +41,7 @@ class AccountsNewsBlurWindowController: NSWindowController { actionButton.title = NSLocalizedString("Create", comment: "Create") signInTextField.stringValue = NSLocalizedString("Sign in to your NewsBlur account.", comment: "SignIn") } - + enableAutofill() usernameTextField.becomeFirstResponder() } @@ -127,4 +127,12 @@ class AccountsNewsBlurWindowController: NSWindowController { NSWorkspace.shared.open(URL(string: "https://newsblur.com")!) } + // MARK: Autofill + func enableAutofill() { + if #available(macOS 11, *) { + usernameTextField.contentType = .username + passwordTextField.contentType = .password + } + } + } diff --git a/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift b/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift index 9dfac12c4..ad578d0fa 100644 --- a/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift +++ b/Mac/Preferences/Accounts/AccountsReaderAPIWindowController.swift @@ -72,6 +72,7 @@ class AccountsReaderAPIWindowController: NSWindowController { actionButton.title = NSLocalizedString("Create", comment: "Create") } + enableAutofill() usernameTextField.becomeFirstResponder() } @@ -194,5 +195,12 @@ class AccountsReaderAPIWindowController: NSWindowController { } } + // MARK: Autofill + func enableAutofill() { + if #available(macOS 11, *) { + usernameTextField.contentType = .username + passwordTextField.contentType = .password + } + } } diff --git a/iOS/Account/FeedWranglerAccountViewController.swift b/iOS/Account/FeedWranglerAccountViewController.swift index 5545a856f..f324296fc 100644 --- a/iOS/Account/FeedWranglerAccountViewController.swift +++ b/iOS/Account/FeedWranglerAccountViewController.swift @@ -158,7 +158,7 @@ class FeedWranglerAccountViewController: UITableViewController { } @IBAction func retrievePasswordDetailsFrom1Password(_ sender: Any) { - OnePasswordExtension.shared().findLogin(forURLString: "feedwrangler.com", for: self, sender: nil) { [self] loginDictionary, error in + OnePasswordExtension.shared().findLogin(forURLString: "feedwrangler.com", for: self, sender: sender) { [self] loginDictionary, error in if let loginDictionary = loginDictionary { emailTextField.text = loginDictionary[AppExtensionUsernameKey] as? String passwordTextField.text = loginDictionary[AppExtensionPasswordKey] as? String diff --git a/iOS/Account/FeedbinAccountViewController.swift b/iOS/Account/FeedbinAccountViewController.swift index 2400b7e1b..4e1d11ea4 100644 --- a/iOS/Account/FeedbinAccountViewController.swift +++ b/iOS/Account/FeedbinAccountViewController.swift @@ -81,7 +81,7 @@ class FeedbinAccountViewController: UITableViewController { } @IBAction func retrievePasswordDetailsFrom1Password(_ sender: Any) { - OnePasswordExtension.shared().findLogin(forURLString: "feedbin.com", for: self, sender: nil) { [self] loginDictionary, error in + OnePasswordExtension.shared().findLogin(forURLString: "feedbin.com", for: self, sender: self) { [self] loginDictionary, error in if let loginDictionary = loginDictionary { emailTextField.text = loginDictionary[AppExtensionUsernameKey] as? String passwordTextField.text = loginDictionary[AppExtensionPasswordKey] as? String diff --git a/iOS/Account/NewsBlurAccountViewController.swift b/iOS/Account/NewsBlurAccountViewController.swift index e771ad7cd..42941ff13 100644 --- a/iOS/Account/NewsBlurAccountViewController.swift +++ b/iOS/Account/NewsBlurAccountViewController.swift @@ -159,7 +159,7 @@ class NewsBlurAccountViewController: UITableViewController { } @IBAction func retrievePasswordDetailsFrom1Password(_ sender: Any) { - OnePasswordExtension.shared().findLogin(forURLString: "newsblur.com", for: self, sender: nil) { [self] loginDictionary, error in + OnePasswordExtension.shared().findLogin(forURLString: "newsblur.com", for: self, sender: sender) { [self] loginDictionary, error in if let loginDictionary = loginDictionary { usernameTextField.text = loginDictionary[AppExtensionUsernameKey] as? String passwordTextField.text = loginDictionary[AppExtensionPasswordKey] as? String diff --git a/iOS/Account/ReaderAPIAccountViewController.swift b/iOS/Account/ReaderAPIAccountViewController.swift index beabeef2e..faf7537bf 100644 --- a/iOS/Account/ReaderAPIAccountViewController.swift +++ b/iOS/Account/ReaderAPIAccountViewController.swift @@ -284,7 +284,7 @@ class ReaderAPIAccountViewController: UITableViewController { url = "" } - OnePasswordExtension.shared().findLogin(forURLString: url, for: self, sender: nil) { [self] loginDictionary, error in + OnePasswordExtension.shared().findLogin(forURLString: url, for: self, sender: sender) { [self] loginDictionary, error in if let loginDictionary = loginDictionary { usernameTextField.text = loginDictionary[AppExtensionUsernameKey] as? String passwordTextField.text = loginDictionary[AppExtensionPasswordKey] as? String diff --git a/xcconfig/NetNewsWire_iOSapp_target.xcconfig b/xcconfig/NetNewsWire_iOSapp_target.xcconfig index 242bef269..0d5ed6927 100644 --- a/xcconfig/NetNewsWire_iOSapp_target.xcconfig +++ b/xcconfig/NetNewsWire_iOSapp_target.xcconfig @@ -42,6 +42,5 @@ CODE_SIGN_ENTITLEMENTS = iOS/Resources/NetNewsWire$(DEVELOPER_ENTITLEMENTS).enti PRODUCT_BUNDLE_IDENTIFIER = $(ORGANIZATION_IDENTIFIER).NetNewsWire.iOS PRODUCT_NAME = NetNewsWire CLANG_ENABLE_MODULES = YES -LD_RUNPATH_SEARCH_PATHS = ("$(inherited)","@executable_path/Frameworks",) SWIFT_OBJC_BRIDGING_HEADER = iOS/Resources/NetNewsWire-iOS-Bridging-Header.h SWIFT_VERSION = 5.0