Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit a22b96f

Browse files
authored
Merge pull request #544 from wordpress-mobile/issue/543-tos-padding
Display a spacer cell instead of TOS when host apps remove the link to WP.com terms of service.
2 parents 4c22001 + 9cca208 commit a22b96f

File tree

6 files changed

+53
-4
lines changed

6 files changed

+53
-4
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressAuthenticator"
3-
s.version = "1.31.0"
3+
s.version = "1.32.0-beta.1"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC

WordPressAuthenticator.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@
163163
D8610CEC2570A60C00A5DF27 /* NavigationToRootTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8610CEB2570A60C00A5DF27 /* NavigationToRootTests.swift */; };
164164
D8611A63257622ED00A5DF27 /* NavigateBack.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8611A62257622ED00A5DF27 /* NavigateBack.swift */; };
165165
D8611A672576236800A5DF27 /* NavigateBackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8611A662576236800A5DF27 /* NavigateBackTests.swift */; };
166+
D87F120B2586DA26005675C5 /* SpacerTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87F12092586DA26005675C5 /* SpacerTableViewCell.swift */; };
167+
D87F120C2586DA26005675C5 /* SpacerTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D87F120A2586DA26005675C5 /* SpacerTableViewCell.xib */; };
166168
D881A30D256B5A7900FE5605 /* NavigationCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = D881A30C256B5A7900FE5605 /* NavigationCommand.swift */; };
167169
D881A311256B5B4700FE5605 /* NavigateToEnterSite.swift in Sources */ = {isa = PBXBuildFile; fileRef = D881A310256B5B4700FE5605 /* NavigateToEnterSite.swift */; };
168170
D881A315256B5B5800FE5605 /* NavigateToEnterAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = D881A314256B5B5800FE5605 /* NavigateToEnterAccount.swift */; };
@@ -375,6 +377,8 @@
375377
D8610CEB2570A60C00A5DF27 /* NavigationToRootTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationToRootTests.swift; sourceTree = "<group>"; };
376378
D8611A62257622ED00A5DF27 /* NavigateBack.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigateBack.swift; sourceTree = "<group>"; };
377379
D8611A662576236800A5DF27 /* NavigateBackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigateBackTests.swift; sourceTree = "<group>"; };
380+
D87F12092586DA26005675C5 /* SpacerTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpacerTableViewCell.swift; sourceTree = "<group>"; };
381+
D87F120A2586DA26005675C5 /* SpacerTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SpacerTableViewCell.xib; sourceTree = "<group>"; };
378382
D881A30C256B5A7900FE5605 /* NavigationCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationCommand.swift; sourceTree = "<group>"; };
379383
D881A310256B5B4700FE5605 /* NavigateToEnterSite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigateToEnterSite.swift; sourceTree = "<group>"; };
380384
D881A314256B5B5800FE5605 /* NavigateToEnterAccount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigateToEnterAccount.swift; sourceTree = "<group>"; };
@@ -876,6 +880,8 @@
876880
CE6BCD3724A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.xib */,
877881
98F40AEF24F5E13200A72911 /* TextWithLinkTableViewCell.swift */,
878882
98F40AEE24F5E13200A72911 /* TextWithLinkTableViewCell.xib */,
883+
D87F12092586DA26005675C5 /* SpacerTableViewCell.swift */,
884+
D87F120A2586DA26005675C5 /* SpacerTableViewCell.xib */,
879885
);
880886
path = "Reusable Views";
881887
sourceTree = "<group>";
@@ -1065,6 +1071,7 @@
10651071
CE1BBF8D24D48580001D2E3E /* GravatarEmailTableViewCell.xib in Resources */,
10661072
B560913F208A563800399AE4 /* Login.storyboard in Resources */,
10671073
CE6BCD3924A3CB5E001BCDC5 /* TextLinkButtonTableViewCell.xib in Resources */,
1074+
D87F120C2586DA26005675C5 /* SpacerTableViewCell.xib in Resources */,
10681075
CE6BCD2F24A3A235001BCDC5 /* TextLabelTableViewCell.xib in Resources */,
10691076
98CF18F9248725620047B66C /* GoogleSignupConfirmation.storyboard in Resources */,
10701077
B5609137208A563800399AE4 /* EmailMagicLink.storyboard in Resources */,
@@ -1262,6 +1269,7 @@
12621269
98CF18F7248725370047B66C /* GoogleSignupConfirmationViewController.swift in Sources */,
12631270
BA53D65324DFEA58001F1ABF /* OnePasswordResultsFetcher.swift in Sources */,
12641271
1A21EE9822832BC300C940C6 /* WordPressComOAuthClientFacade+Swift.swift in Sources */,
1272+
D87F120B2586DA26005675C5 /* SpacerTableViewCell.swift in Sources */,
12651273
CEC77C6624854F2E00FB9050 /* SiteAddressViewController.swift in Sources */,
12661274
CEDE0D952420121D00CB3345 /* UIStoryboard+Helpers.swift in Sources */,
12671275
B5ED7920207E993E00A8FD8C /* WPAuthenticatorLogging.m in Sources */,

WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ private extension GetStartedViewController {
195195
let cells = [
196196
TextLabelTableViewCell.reuseIdentifier: TextLabelTableViewCell.loadNib(),
197197
TextFieldTableViewCell.reuseIdentifier: TextFieldTableViewCell.loadNib(),
198-
TextWithLinkTableViewCell.reuseIdentifier: TextWithLinkTableViewCell.loadNib()
198+
TextWithLinkTableViewCell.reuseIdentifier: TextWithLinkTableViewCell.loadNib(),
199+
SpacerTableViewCell.reuseIdentifier: SpacerTableViewCell.loadNib()
199200
]
200201

201202
for (reuseIdentifier, nib) in cells {
@@ -210,8 +211,10 @@ private extension GetStartedViewController {
210211

211212
if let authenticationDelegate = WordPressAuthenticator.shared.delegate, authenticationDelegate.wpcomTermsOfServiceEnabled {
212213
rows.append(.tos)
214+
} else {
215+
rows.append(.spacer)
213216
}
214-
217+
215218
if let errorText = errorMessage, !errorText.isEmpty {
216219
rows.append(.errorMessage)
217220
}
@@ -227,6 +230,8 @@ private extension GetStartedViewController {
227230
configureEmailField(cell)
228231
case let cell as TextWithLinkTableViewCell:
229232
configureTextWithLink(cell)
233+
case cell as SpacerTableViewCell:
234+
break
230235
case let cell as TextLabelTableViewCell where row == .errorMessage:
231236
configureErrorLabel(cell)
232237
default:
@@ -300,6 +305,7 @@ private extension GetStartedViewController {
300305
case instructions
301306
case email
302307
case tos
308+
case spacer
303309
case errorMessage
304310

305311
var reuseIdentifier: String {
@@ -310,6 +316,8 @@ private extension GetStartedViewController {
310316
return TextFieldTableViewCell.reuseIdentifier
311317
case .tos:
312318
return TextWithLinkTableViewCell.reuseIdentifier
319+
case .spacer:
320+
return SpacerTableViewCell.reuseIdentifier
313321
}
314322
}
315323
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import UIKit
2+
3+
/// SpacerTableViewCell: an empty cell, used as separator and to introduce padding.
4+
///
5+
final class SpacerTableViewCell: UITableViewCell {
6+
static let reuseIdentifier = "SpacerTableViewCell"
7+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3+
<device id="retina6_1" orientation="portrait" appearance="light"/>
4+
<dependencies>
5+
<deployment identifier="iOS"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
7+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
8+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
9+
</dependencies>
10+
<objects>
11+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
12+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
13+
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="16" id="KGk-i7-Jjw" customClass="SpacerTableViewCell" customModule="WordPressAuthenticator" customModuleProvider="target">
14+
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
15+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
16+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
17+
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
18+
<autoresizingMask key="autoresizingMask"/>
19+
</tableViewCellContentView>
20+
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
21+
<accessibility key="accessibilityConfiguration">
22+
<accessibilityTraits key="traits" notEnabled="YES"/>
23+
</accessibility>
24+
<point key="canvasLocation" x="-83" y="95"/>
25+
</tableViewCell>
26+
</objects>
27+
</document>

WordPressAuthenticator/Unified Auth/View Related/Reusable Views/TextWithLinkTableViewCell.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,4 @@ class TextWithLinkTableViewCell: UITableViewCell {
4141
button.setAttributedTitle(highlightAttributedString, for: .highlighted)
4242
button.accessibilityTraits = accessibilityTrait
4343
}
44-
4544
}

0 commit comments

Comments
 (0)