Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UL&S: Add TextLinkTableViewCell to SiteAddressViewController #308

Merged
merged 65 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
73858b5
Clean up missing declarations for InstructionTableViewCell
mindgraffiti Jun 19, 2020
fa5843d
Clean up declarations and make them uniform for TextFieldTableViewCell
mindgraffiti Jun 19, 2020
2dba315
Add PlainTextButtonTableViewCell class and nib file
mindgraffiti Jun 19, 2020
ddee1f7
Add plain text button color to unified styles
mindgraffiti Jun 19, 2020
6d3ef7d
Add button IBOutlet to cell, style it, add public property to set string
mindgraffiti Jun 19, 2020
b21628f
Add reuse identifier
mindgraffiti Jun 19, 2020
f5f6bb8
Add button title text for resetting password
mindgraffiti Jun 19, 2020
039b5ef
Keep naming to two words for brevity's sake
mindgraffiti Jun 19, 2020
6d0fd14
Add the reset password row and configure it
mindgraffiti Jun 19, 2020
8aa83f2
Bump podspec
mindgraffiti Jun 19, 2020
9179421
Make the project file identify the renamed cell file
mindgraffiti Jun 19, 2020
fb31896
Rename the style properties too
mindgraffiti Jun 19, 2020
ab4225d
Use the renamed style properties
mindgraffiti Jun 19, 2020
90725c8
Merge branch 'develop' into feature/283-site-address-vi
mindgraffiti Jun 23, 2020
2cfbc15
Merge branch 'develop' into feature/283-site-address-vi
mindgraffiti Jun 23, 2020
6de570a
Merge conflicts
mindgraffiti Jun 23, 2020
8c1c8ac
Remove table settings - not needed to get cells to adjust height
mindgraffiti Jun 23, 2020
3b69f55
Remove access to the instructionLabel and use a public variable for text
mindgraffiti Jun 23, 2020
f3cc6d5
Keep the formatting the same between cells
mindgraffiti Jun 23, 2020
cdce12c
rowHeight constant not used any more
mindgraffiti Jun 23, 2020
a9a391d
Add code comments
mindgraffiti Jun 23, 2020
e34744e
Change the TextFieldTableViewCell to be configurable
mindgraffiti Jun 23, 2020
592908c
Configure the TextFieldTableViewCell found in SiteAddressVC
mindgraffiti Jun 23, 2020
39a8a87
Add code comments
mindgraffiti Jun 23, 2020
4ceabd6
Rename TextButtonTableViewCell to TextLinkTableViewCell
mindgraffiti Jun 23, 2020
d637b49
Finish renaming to TextLinkTableViewCell
mindgraffiti Jun 23, 2020
af2f3e7
Remove `becomeFirstResponder` from TextFieldTableViewCell
mindgraffiti Jun 23, 2020
a464568
Make the button title align left
mindgraffiti Jun 23, 2020
d3b46a4
Add another UIView helper that finds the first subview
mindgraffiti Jun 23, 2020
d556bfc
Show / hide the LinkTextTableViewCell by enabling / disabling hint
mindgraffiti Jun 23, 2020
9c75dec
Show or hide the LinkTextTableViewCell row based on the configuration
mindgraffiti Jun 23, 2020
f2d1288
Make the first textField the first responder, so the keyboard will show
mindgraffiti Jun 23, 2020
7af16d3
Remove selection style
mindgraffiti Jun 23, 2020
ab52213
Add button action handler for TextLinkTableViewCell's button
mindgraffiti Jun 23, 2020
d97f498
Set the actionHandler to present a fancy alert
mindgraffiti Jun 23, 2020
69f17ef
Change hint button text to the correct string
mindgraffiti Jun 23, 2020
a384375
Remove firstSubview helper method
mindgraffiti Jun 23, 2020
f86b247
Expose the textField so that it can becomeFirstResponder if needed
mindgraffiti Jun 23, 2020
c4ee1fd
Save a reference to the first textfield. Make it the first responder.
mindgraffiti Jun 23, 2020
1cd5e85
Store a reference to the first textfield in the new property
mindgraffiti Jun 23, 2020
f7d7535
Update code comments and file access control to a property
mindgraffiti Jun 23, 2020
b6c21e1
Rename InstructionTableViewCell to TextLabelTableViewCell
mindgraffiti Jun 24, 2020
daa69b1
Don't use a local reference. Use displayStrings directly.
mindgraffiti Jun 24, 2020
5a156fd
Update the Instruction cell to TextLabelTableViewCell in SiteAddressVC
mindgraffiti Jun 24, 2020
88d3213
Add a text color for the TextLabelTableViewCell
mindgraffiti Jun 24, 2020
b6b9958
Delete the TextLinkTableViewCell
mindgraffiti Jun 24, 2020
3d66384
Change incorrectly named row case, resetPassword to findSiteAddress
mindgraffiti Jun 24, 2020
795119e
Update method name
mindgraffiti Jun 24, 2020
544e283
Add button styling option to TextLabelTableViewCell
mindgraffiti Jun 24, 2020
62a3262
Remove more references to TextLinkTableViewCell
mindgraffiti Jun 24, 2020
a176b8c
Remove selection style
mindgraffiti Jun 24, 2020
fecd77c
Set common textfield settings
mindgraffiti Jun 24, 2020
d85347a
Add a helper method to access indices safely on Collections
mindgraffiti Jun 24, 2020
05e9546
Set .cancelsTouchesInView to false so that tableView row taps aren't …
mindgraffiti Jun 24, 2020
bab0217
If the findSiteAddress row is selected, show the fancy alert
mindgraffiti Jun 24, 2020
1a399e4
Enable dynamic text
mindgraffiti Jun 24, 2020
92b444d
Enable accessibility elements
mindgraffiti Jun 24, 2020
206bc3b
Add TextLinkButtonTableViewCell
mindgraffiti Jun 24, 2020
32ba017
Turn of .cancelsTouchesInView
mindgraffiti Jun 24, 2020
6edd058
Remove unused .button case
mindgraffiti Jun 24, 2020
8aa49c3
Hint buttons should be enabled by default
mindgraffiti Jun 24, 2020
9335756
Change how the fancy alert is presented
mindgraffiti Jun 24, 2020
4baaa7a
Organize elements so they are easier to understand when read by Voice…
mindgraffiti Jun 24, 2020
dfbcd74
Delete unused extension CollectionType+AuthHelpers
mindgraffiti Jun 25, 2020
08f1ab1
Don't use a local variable to store the configuration preferences
mindgraffiti Jun 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPressAuthenticator.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "WordPressAuthenticator"
s.version = "1.19.0-beta.3"
s.version = "1.19.0-beta.4"
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."

s.description = <<-DESC
Expand Down
28 changes: 18 additions & 10 deletions WordPressAuthenticator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@
B5ED791D207E993E00A8FD8C /* WPAuthenticatorLogging.h in Headers */ = {isa = PBXBuildFile; fileRef = B5ED7918207E993E00A8FD8C /* WPAuthenticatorLogging.h */; settings = {ATTRIBUTES = (Public, ); }; };
B5ED791F207E993E00A8FD8C /* CocoaLumberjack.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5ED791A207E993E00A8FD8C /* CocoaLumberjack.swift */; };
B5ED7920207E993E00A8FD8C /* WPAuthenticatorLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = B5ED791B207E993E00A8FD8C /* WPAuthenticatorLogging.m */; };
CE00B6EA248AD72E00A91173 /* InstructionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE00B6E8248AD72E00A91173 /* InstructionTableViewCell.swift */; };
CE00B6EB248AD72E00A91173 /* InstructionTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE00B6E9248AD72E00A91173 /* InstructionTableViewCell.xib */; };
CE16177521B6D82200B82A47 /* WordPressAuthenticatorDisplayStrings.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE16177421B6D82200B82A47 /* WordPressAuthenticatorDisplayStrings.swift */; };
CE16177821B70C1A00B82A47 /* WordPressAuthenticatorDisplayTextTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE16177721B70C1A00B82A47 /* WordPressAuthenticatorDisplayTextTests.swift */; };
CE1B18C920EEC2C200BECC3F /* SocialService.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE1B18C820EEC2C200BECC3F /* SocialService.swift */; };
Expand All @@ -122,9 +120,13 @@
CE30A2A722579F4100DF3CDA /* LoginUsernamePasswordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE30A2A622579F4100DF3CDA /* LoginUsernamePasswordViewController.swift */; };
CE30A2A92257C60500DF3CDA /* WordPressOrgCredentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE30A2A82257C60500DF3CDA /* WordPressOrgCredentials.swift */; };
CE30A2AD2257CECC00DF3CDA /* AuthenticatorCredentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE30A2AC2257CECC00DF3CDA /* AuthenticatorCredentials.swift */; };
CE9091FE249A720E00AB50BD /* UIView+AuthHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9091FD249A720E00AB50BD /* UIView+AuthHelpers.swift */; };
CE6BCD2E24A3A235001BCDC5 /* TextLabelTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6BCD2C24A3A235001BCDC5 /* TextLabelTableViewCell.swift */; };
CE6BCD2F24A3A235001BCDC5 /* TextLabelTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE6BCD2D24A3A235001BCDC5 /* TextLabelTableViewCell.xib */; };
CE6BCD3824A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE6BCD3624A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.swift */; };
CE6BCD3924A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE6BCD3724A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.xib */; };
CE9091F72499549500AB50BD /* TextFieldTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9091F52499549500AB50BD /* TextFieldTableViewCell.swift */; };
CE9091F82499549500AB50BD /* TextFieldTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE9091F62499549500AB50BD /* TextFieldTableViewCell.xib */; };
CE9091FE249A720E00AB50BD /* UIView+AuthHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9091FD249A720E00AB50BD /* UIView+AuthHelpers.swift */; };
CEC77C6624854F2E00FB9050 /* SiteAddressViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC77C6524854F2E00FB9050 /* SiteAddressViewController.swift */; };
CEC77C6824854F3E00FB9050 /* SiteAddress.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CEC77C6724854F3E00FB9050 /* SiteAddress.storyboard */; };
CEDE0D93242011E000CB3345 /* NSObject+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEDE0D92242011E000CB3345 /* NSObject+Helpers.swift */; };
Expand Down Expand Up @@ -278,8 +280,6 @@
B5ED791A207E993E00A8FD8C /* CocoaLumberjack.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CocoaLumberjack.swift; sourceTree = "<group>"; };
B5ED791B207E993E00A8FD8C /* WPAuthenticatorLogging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WPAuthenticatorLogging.m; sourceTree = "<group>"; };
C736FF243DE333FCAB1C2614 /* Pods_WordPressAuthenticator.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_WordPressAuthenticator.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CE00B6E8248AD72E00A91173 /* InstructionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstructionTableViewCell.swift; sourceTree = "<group>"; };
CE00B6E9248AD72E00A91173 /* InstructionTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InstructionTableViewCell.xib; sourceTree = "<group>"; };
CE16177421B6D82200B82A47 /* WordPressAuthenticatorDisplayStrings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordPressAuthenticatorDisplayStrings.swift; sourceTree = "<group>"; };
CE16177721B70C1A00B82A47 /* WordPressAuthenticatorDisplayTextTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordPressAuthenticatorDisplayTextTests.swift; sourceTree = "<group>"; };
CE1B18C820EEC2C200BECC3F /* SocialService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocialService.swift; sourceTree = "<group>"; };
Expand All @@ -290,9 +290,13 @@
CE30A2A622579F4100DF3CDA /* LoginUsernamePasswordViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoginUsernamePasswordViewController.swift; sourceTree = "<group>"; };
CE30A2A82257C60500DF3CDA /* WordPressOrgCredentials.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordPressOrgCredentials.swift; sourceTree = "<group>"; };
CE30A2AC2257CECC00DF3CDA /* AuthenticatorCredentials.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticatorCredentials.swift; sourceTree = "<group>"; };
CE9091FD249A720E00AB50BD /* UIView+AuthHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+AuthHelpers.swift"; sourceTree = "<group>"; };
CE6BCD2C24A3A235001BCDC5 /* TextLabelTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextLabelTableViewCell.swift; sourceTree = "<group>"; };
CE6BCD2D24A3A235001BCDC5 /* TextLabelTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TextLabelTableViewCell.xib; sourceTree = "<group>"; };
CE6BCD3624A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextLinkButtonTableViewCell.swift; sourceTree = "<group>"; };
CE6BCD3724A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TextLinkButtonTableViewCell.xib; sourceTree = "<group>"; };
CE9091F52499549500AB50BD /* TextFieldTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextFieldTableViewCell.swift; sourceTree = "<group>"; };
CE9091F62499549500AB50BD /* TextFieldTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TextFieldTableViewCell.xib; sourceTree = "<group>"; };
CE9091FD249A720E00AB50BD /* UIView+AuthHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+AuthHelpers.swift"; sourceTree = "<group>"; };
CEC77C6524854F2E00FB9050 /* SiteAddressViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SiteAddressViewController.swift; sourceTree = "<group>"; };
CEC77C6724854F3E00FB9050 /* SiteAddress.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = SiteAddress.storyboard; sourceTree = "<group>"; };
CEDE0D92242011E000CB3345 /* NSObject+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSObject+Helpers.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -693,8 +697,10 @@
CEC77C70248AB0C700FB9050 /* Reusable Views */ = {
isa = PBXGroup;
children = (
CE00B6E8248AD72E00A91173 /* InstructionTableViewCell.swift */,
CE00B6E9248AD72E00A91173 /* InstructionTableViewCell.xib */,
CE6BCD3624A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.swift */,
CE6BCD3724A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.xib */,
CE6BCD2C24A3A235001BCDC5 /* TextLabelTableViewCell.swift */,
CE6BCD2D24A3A235001BCDC5 /* TextLabelTableViewCell.xib */,
CE9091F52499549500AB50BD /* TextFieldTableViewCell.swift */,
CE9091F62499549500AB50BD /* TextFieldTableViewCell.xib */,
);
Expand Down Expand Up @@ -822,10 +828,11 @@
B5609118208A555600399AE4 /* SearchTableViewCell.xib in Resources */,
98ED48392480300500992B2D /* GoogleAuth.storyboard in Resources */,
B560913F208A563800399AE4 /* Login.storyboard in Resources */,
CE6BCD3924A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.xib in Resources */,
CE6BCD2F24A3A235001BCDC5 /* TextLabelTableViewCell.xib in Resources */,
98CF18F9248725620047B66C /* GoogleSignupConfirmation.storyboard in Resources */,
B5609137208A563800399AE4 /* EmailMagicLink.storyboard in Resources */,
3FFF2FC123D7ED7C00D38C77 /* EmailClients.plist in Resources */,
CE00B6EB248AD72E00A91173 /* InstructionTableViewCell.xib in Resources */,
FF629D9622393500004C4106 /* WordPressAuthenticator.podspec in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -984,6 +991,7 @@
B56090F7208A533200399AE4 /* WordPressAuthenticator+Errors.swift in Sources */,
B56090D2208A4F5400399AE4 /* NUXButton.swift in Sources */,
CE1B18C920EEC2C200BECC3F /* SocialService.swift in Sources */,
CE6BCD2E24A3A235001BCDC5 /* TextLabelTableViewCell.swift in Sources */,
B56090D3208A4F5400399AE4 /* NUXLinkAuthViewController.swift in Sources */,
B5609120208A555E00399AE4 /* SignupNavigationController.swift in Sources */,
B5609143208A563800399AE4 /* LoginSocialErrorViewController.swift in Sources */,
Expand Down Expand Up @@ -1027,6 +1035,7 @@
CE9091FE249A720E00AB50BD /* UIView+AuthHelpers.swift in Sources */,
CE1B18D220EEC44400BECC3F /* WordPressAuthenticatorStyles.swift in Sources */,
B56090F0208A527000399AE4 /* FancyAlertViewController+LoginError.swift in Sources */,
CE6BCD3824A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.swift in Sources */,
CE16177521B6D82200B82A47 /* WordPressAuthenticatorDisplayStrings.swift in Sources */,
CE1B18CE20EEC3CB00BECC3F /* WordPressAuthenticatorDelegateProtocol.swift in Sources */,
B5609110208A54F800399AE4 /* OnePasswordFacade.swift in Sources */,
Expand All @@ -1050,7 +1059,6 @@
CE30A2A92257C60500DF3CDA /* WordPressOrgCredentials.swift in Sources */,
B56090CB208A4F5400399AE4 /* NUXNavigationController.swift in Sources */,
B560911F208A555E00399AE4 /* SignupGoogleViewController.swift in Sources */,
CE00B6EA248AD72E00A91173 /* InstructionTableViewCell.swift in Sources */,
B5609142208A563800399AE4 /* LoginNavigationController.swift in Sources */,
B56090E4208A4F9D00399AE4 /* WPNUXMainButton.m in Sources */,
3FFF2FC323D7F53200D38C77 /* AppSelector.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public struct WordPressAuthenticatorConfiguration {
///
let enableUnifiedAuth: Bool

/// Hint buttons help users complete a step in the unified auth flow. Enabled by default.
/// If enabled, "Find your site address", "Reset your password", and others will be displayed.
/// If disabled, none of the hint buttons will appear on the unified auth flows.
let displayHintButtons: Bool

/// Flag indicating if the unified login by Site Address flow should display.
///
let enableUnifiedSiteAddress: Bool
Expand All @@ -93,6 +98,7 @@ public struct WordPressAuthenticatorConfiguration {
enableSignInWithApple: Bool = false,
enableSignupWithGoogle: Bool = false,
enableUnifiedAuth: Bool = false,
displayHintButtons: Bool = true,
enableUnifiedSiteAddress: Bool = false,
enableUnifiedGoogle: Bool = false) {

Expand All @@ -109,6 +115,7 @@ public struct WordPressAuthenticatorConfiguration {
self.showLoginOptions = showLoginOptions
self.enableSignInWithApple = enableSignInWithApple
self.enableUnifiedAuth = enableUnifiedAuth
self.displayHintButtons = displayHintButtons
self.enableUnifiedSiteAddress = enableUnifiedAuth && enableUnifiedSiteAddress
self.enableUnifiedGoogle = enableUnifiedAuth && enableUnifiedGoogle
self.enableSignupWithGoogle = enableSignupWithGoogle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,28 @@ public struct WordPressAuthenticatorDisplayStrings {
public let logInTitle: String
public let signUpTitle: String

/// Strings: secondary call-to-action button titles.
///
public let findSiteButtonTitle: String
public let resetPasswordButtonTitle: String

/// Designated initializer.
///
public init(emailLoginInstructions: String,
jetpackLoginInstructions: String,
siteLoginInstructions: String,
continueButtonTitle: String,
findSiteButtonTitle: String,
resetPasswordButtonTitle: String,
gettingStartedTitle: String,
logInTitle: String,
signUpTitle: String) {
self.emailLoginInstructions = emailLoginInstructions
self.jetpackLoginInstructions = jetpackLoginInstructions
self.siteLoginInstructions = siteLoginInstructions
self.continueButtonTitle = continueButtonTitle
self.findSiteButtonTitle = findSiteButtonTitle
self.resetPasswordButtonTitle = resetPasswordButtonTitle
self.gettingStartedTitle = gettingStartedTitle
self.logInTitle = logInTitle
self.signUpTitle = signUpTitle
Expand All @@ -49,7 +58,11 @@ public extension WordPressAuthenticatorDisplayStrings {
siteLoginInstructions: NSLocalizedString("Enter the address of the WordPress site you'd like to connect.",
comment: "Instruction text on the login's site addresss screen."),
continueButtonTitle: NSLocalizedString("Continue",
comment: "The button title text when there is a next step for logging in or signing up."),
comment: "The button title text when there is a next step for logging in or signing up."),
findSiteButtonTitle: NSLocalizedString("Find your site address",
comment: "The hint button's title text to help users find their site address."),
resetPasswordButtonTitle: NSLocalizedString("Reset your password",
comment: "The secondary call-to-action button title text, for when the user can't remember their password."),
gettingStartedTitle: NSLocalizedString("Getting Started",
comment: "View title for initial auth views."),
logInTitle: NSLocalizedString("Log In",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,29 @@ public struct WordPressAuthenticatorUnifiedStyle {
///
public let borderColor: UIColor

/// Style: Auth default text color
///
public let textColor: UIColor

/// Style: Auth plain text button normal state color
///
public let textButtonColor: UIColor

/// Style: Auth plain text button highlight state color
///
public let textButtonHighlightColor: UIColor

/// Style: Auth view background colors
///
public let viewControllerBackgroundColor: UIColor

/// Designated initializer
///
public init(borderColor: UIColor, viewControllerBackgroundColor: UIColor) {
public init(borderColor: UIColor, textColor: UIColor, textButtonColor: UIColor, textButtonHighlightColor: UIColor, viewControllerBackgroundColor: UIColor) {
self.borderColor = borderColor
self.textColor = textColor
self.textButtonColor = textButtonColor
self.textButtonHighlightColor = textButtonHighlightColor
self.viewControllerBackgroundColor = viewControllerBackgroundColor
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,77 @@ import UIKit

/// TextFieldTableViewCell: a textfield with a custom border line in a UITableViewCell.
///
class TextFieldTableViewCell: UITableViewCell {
final class TextFieldTableViewCell: UITableViewCell {

public static let reuseIdentifier = "TextFieldTableViewCell"
/// Private properties
///
@IBOutlet private weak var borderView: UIView!
@IBOutlet private weak var borderWidth: NSLayoutConstraint!

private var hairlineBorderWidth: CGFloat {
return 1.0 / UIScreen.main.scale
}

@IBOutlet var borderView: UIView!
@IBOutlet var borderWidth: NSLayoutConstraint!
@IBOutlet var textField: UITextField!
/// Public properties
///
@IBOutlet public weak var textField: UITextField! // public so it can be the first responder

public static let reuseIdentifier = "TextFieldTableViewCell"

override func awakeFromNib() {
super.awakeFromNib()
styleBorder()
setCommonTextFieldStyles()
}

public func configureTextFieldStyle(with style: TextFieldStyle = .url, and placeholder: String?) {
applyTextFieldStyle(style)
textField.placeholder = placeholder
}
}


// MARK: - Private methods
private extension TextFieldTableViewCell {

/// Style the bottom cell border, called borderView.
///
func styleBorder() {
let borderColor = WordPressAuthenticator.shared.unifiedStyle?.borderColor ?? WordPressAuthenticator.shared.style.primaryNormalBorderColor
borderView.backgroundColor = borderColor
borderWidth.constant = hairlineBorderWidth
}

/// Style the font inside the textField.
///
func setCommonTextFieldStyles() {
textField.font = UIFont.preferredFont(forTextStyle: .body)
textField.autocorrectionType = .no
textField.returnKeyType = .continue
}

/// Style the textField.
/// - note: Don't assign first responder here. It's too early in the view lifecycle.
///
func applyTextFieldStyle(_ style: TextFieldStyle) {
switch style {
case .url:
textField.keyboardType = .URL
default:
setCommonTextFieldStyles()
}
}
}


// MARK: - Constants
extension TextFieldTableViewCell {

/// TextField configuration options.
///
enum TextFieldStyle {
case url
case username
case password
}
}
Loading