Skip to content

Commit

Permalink
Public release 1.15.0
Browse files Browse the repository at this point in the history
Public release 1.15.0
  • Loading branch information
dmytrokhl committed Jul 19, 2023
2 parents fcbbd6e + 398edac commit 4ff5c1d
Show file tree
Hide file tree
Showing 198 changed files with 503 additions and 253 deletions.
44 changes: 31 additions & 13 deletions Sources/VGSCollectSDK/UIElements/Text Field/VGSTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,37 @@ public class VGSTextField: UIView {
}
}

/// A succinct label in a localized string that identifies the accessibility text field.
public var textFieldAccessibilityLabel: String? {
didSet {
textField.accessibilityLabel = textFieldAccessibilityLabel
}
}

/// A localized string that contains a brief description of the result of performing an action on the accessibility text field.
public var textFieldAccessibilityHint: String? {
didSet {
textField.accessibilityHint = textFieldAccessibilityHint
}
}
// MARK: - Accessibility Attributes
/// A succinct label in a localized string that identifies the accessibility text field.
public var textFieldAccessibilityLabel: String? {
get {
return textField.accessibilityLabel
}
set {
textField.accessibilityLabel = newValue
}
}

/// A localized string that contains a brief description of the result of
/// performing an action on the accessibility text field.
public var textFieldAccessibilityHint: String? {
get {
return textField.accessibilityHint
}
set {
textField.accessibilityHint = newValue
}
}

/// Boolean value that determinates if the text field should be exposed as an accesibility element.
public var textFieldIsAccessibilityElement: Bool {
get {
return textField.isAccessibilityElement
}
set {
textField.isAccessibilityElement = newValue
}
}

// MARK: - Functional Attributes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// VGSCollectSDK
//

import Foundation

/// Format used to validate a VGS date text input
public enum VGSDateFormat: InputConvertableFormat, OutputConvertableFormat {
case mmddyyyy
Expand Down
2 changes: 1 addition & 1 deletion Sources/VGSCollectSDK/Utils/Extensions/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ internal class Utils {

/// VGS Collect SDK Version.
/// Necessary since SPM doesn't track info plist correctly: https://forums.swift.org/t/add-info-plist-on-spm-bundle/40274/5
static let vgsCollectVersion: String = "1.14.0"
static let vgsCollectVersion: String = "1.15.0"
}

extension Dictionary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,29 @@ class CVVTextFieldTests: VGSCollectBaseTestCase {
cardNumberTextField.focusOn()
XCTAssert(cvvTextField.textField.formatPattern == "####", "Default format is wrong. Should be ####")
}

/// Test accessibility properties
func testAccessibilityAttributes() {
// Hint
let accHint = "accessibility hint"
cvvTextField.textFieldAccessibilityHint = accHint
XCTAssertNotNil(cvvTextField.textFieldAccessibilityHint)
XCTAssertEqual(cvvTextField.textFieldAccessibilityHint, accHint)

// Label
let accLabel = "accessibility label"
cvvTextField.textFieldAccessibilityLabel = accLabel
XCTAssertNotNil(cvvTextField.textFieldAccessibilityLabel)
XCTAssertEqual(cvvTextField.textFieldAccessibilityLabel, accLabel)

// Element
cvvTextField.textFieldIsAccessibilityElement = true
XCTAssertTrue(cvvTextField.textFieldIsAccessibilityElement)

// Value
let accValue = "accessibility value"
cvvTextField.textField.secureText = accValue
XCTAssertTrue(cvvTextField.textField.secureText!.isEmpty)
XCTAssertNil(cvvTextField.textField.accessibilityValue)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,29 @@ class CardHolderNameFieldTests: VGSCollectBaseTestCase {
XCTAssertFalse(cardHolderTextField.state.isValid)
XCTAssertFalse(cardHolderTextField.state.isEmpty)
}

/// Test accessibility properties
func testAccessibilityAttributes() {
// Hint
let accHint = "accessibility hint"
cardHolderTextField.textFieldAccessibilityHint = accHint
XCTAssertNotNil(cardHolderTextField.textFieldAccessibilityHint)
XCTAssertEqual(cardHolderTextField.textFieldAccessibilityHint, accHint)

// Label
let accLabel = "accessibility label"
cardHolderTextField.textFieldAccessibilityLabel = accLabel
XCTAssertNotNil(cardHolderTextField.textFieldAccessibilityLabel)
XCTAssertEqual(cardHolderTextField.textFieldAccessibilityLabel, accLabel)

// Element
cardHolderTextField.textFieldIsAccessibilityElement = true
XCTAssertTrue(cardHolderTextField.textFieldIsAccessibilityElement)

// Value
let accValue = "accessibility value"
cardHolderTextField.textField.secureText = accValue
XCTAssertFalse(cardHolderTextField.textField.secureText!.isEmpty)
XCTAssertNil(cardHolderTextField.textField.accessibilityValue)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,29 @@ class CardNumerTextFieldTests: VGSCollectBaseTestCase {
}
}
}

/// Test accessibility properties
func testAccessibilityAttributes() {
// Hint
let accHint = "accessibility hint"
cardNumerTextField.textFieldAccessibilityHint = accHint
XCTAssertNotNil(cardNumerTextField.textFieldAccessibilityHint)
XCTAssertEqual(cardNumerTextField.textFieldAccessibilityHint, accHint)

// Label
let accLabel = "accessibility label"
cardNumerTextField.textFieldAccessibilityLabel = accLabel
XCTAssertNotNil(cardNumerTextField.textFieldAccessibilityLabel)
XCTAssertEqual(cardNumerTextField.textFieldAccessibilityLabel, accLabel)

// Element
cardNumerTextField.textFieldIsAccessibilityElement = true
XCTAssertTrue(cardNumerTextField.textFieldIsAccessibilityElement)

// Value
let accValue = "accessibility value"
cardNumerTextField.textField.secureText = accValue
XCTAssertTrue(cardNumerTextField.textField.secureText!.isEmpty)
XCTAssertNil(cardNumerTextField.textField.accessibilityValue)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,29 @@ class DateTextFieldTest: VGSCollectBaseTestCase {
XCTAssertTrue(textField.textField.inputView != nil, "Date picker not set!")
XCTAssertTrue(textField.textField.inputView is UIPickerView, "Wrong date picker view!")
}

/// Test accessibility properties
func testAccessibilityAttributes() {
// Hint
let accHint = "accessibility hint"
textField.textFieldAccessibilityHint = accHint
XCTAssertNotNil(textField.textFieldAccessibilityHint)
XCTAssertEqual(textField.textFieldAccessibilityHint, accHint)

// Label
let accLabel = "accessibility label"
textField.textFieldAccessibilityLabel = accLabel
XCTAssertNotNil(textField.textFieldAccessibilityLabel)
XCTAssertEqual(textField.textFieldAccessibilityLabel, accLabel)

// Element
textField.textFieldIsAccessibilityElement = true
XCTAssertTrue(textField.textFieldIsAccessibilityElement)

// Value
let accValue = "accessibility value"
textField.textField.secureText = accValue
XCTAssertTrue(textField.textField.secureText!.isEmpty)
XCTAssertNil(textField.textField.accessibilityValue)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,29 @@ class ExpDateTextField: VGSCollectBaseTestCase {
XCTAssertTrue(textField.textField.inputView != nil, "Date picker not set!")
XCTAssertTrue(textField.textField.inputView is UIPickerView, "Wrong date picker view!")
}

/// Test accessibility properties
func testAccessibilityAttributes() {
// Hint
let accHint = "accessibility hint"
textField.textFieldAccessibilityHint = accHint
XCTAssertNotNil(textField.textFieldAccessibilityHint)
XCTAssertEqual(textField.textFieldAccessibilityHint, accHint)

// Label
let accLabel = "accessibility label"
textField.textFieldAccessibilityLabel = accLabel
XCTAssertNotNil(textField.textFieldAccessibilityLabel)
XCTAssertEqual(textField.textFieldAccessibilityLabel, accLabel)

// Element
textField.textFieldIsAccessibilityElement = true
XCTAssertTrue(textField.textFieldIsAccessibilityElement)

// Value
let accValue = "accessibility value"
textField.textField.secureText = accValue
XCTAssertTrue(textField.textField.secureText!.isEmpty)
XCTAssertNil(textField.textField.accessibilityValue)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,29 @@ class SSNTextFieldTests: VGSCollectBaseTestCase {
}
}
}

/// Test accessibility properties
func testAccessibilityAttributes() {
// Hint
let accHint = "accessibility hint"
ssnTextField.textFieldAccessibilityHint = accHint
XCTAssertNotNil(ssnTextField.textFieldAccessibilityHint)
XCTAssertEqual(ssnTextField.textFieldAccessibilityHint, accHint)

// Label
let accLabel = "accessibility label"
ssnTextField.textFieldAccessibilityLabel = accLabel
XCTAssertNotNil(ssnTextField.textFieldAccessibilityLabel)
XCTAssertEqual(ssnTextField.textFieldAccessibilityLabel, accLabel)

// Element
ssnTextField.textFieldIsAccessibilityElement = true
XCTAssertTrue(ssnTextField.textFieldIsAccessibilityElement)

// Value
let accValue = "accessibility value"
ssnTextField.textField.secureText = accValue
XCTAssertTrue(ssnTextField.textField.secureText!.isEmpty)
XCTAssertNil(ssnTextField.textField.accessibilityValue)
}
}
2 changes: 1 addition & 1 deletion VGSCollectSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'VGSCollectSDK'
spec.version = '1.14.0'
spec.version = '1.15.0'
spec.summary = 'VGS Collect - is a product suite that allows customers to collect information securely without possession of it.'
spec.swift_version = '5.0'
spec.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions VGSCollectSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2045,7 +2045,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.12.0;
MARKETING_VERSION = 1.15.0;
PRODUCT_BUNDLE_IDENTIFIER = com.vgs.framework;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -2077,7 +2077,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.12.0;
MARKETING_VERSION = 1.15.0;
PRODUCT_BUNDLE_IDENTIFIER = com.vgs.framework;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 2 additions & 2 deletions demoapp/demoapp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
971F95F0CD23156BC2F071A3 /* Pods-demoappUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoappUITests.release.xcconfig"; path = "Target Support Files/Pods-demoappUITests/Pods-demoappUITests.release.xcconfig"; sourceTree = "<group>"; };
9E14BE9AC3107988B3A45EBF /* Pods-demoapp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoapp.release.xcconfig"; path = "Target Support Files/Pods-demoapp/Pods-demoapp.release.xcconfig"; sourceTree = "<group>"; };
A01CE3F429E5C50D0059700F /* DateValidationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateValidationViewController.swift; sourceTree = "<group>"; };
A06681532A58BB6500B93FC6 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
B96EAC87AAF5BF889451003A /* Pods-demoapp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-demoapp.debug.xcconfig"; path = "Target Support Files/Pods-demoapp/Pods-demoapp.debug.xcconfig"; sourceTree = "<group>"; };
C0DAC2D9D525DA573788F57B /* Pods_demoapp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_demoapp.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FD12B9742304616C00B670DD /* demoapp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = demoapp.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -145,7 +146,6 @@
FD12B9992304616E00B670DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FDD398EF247D7A7100B55057 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
FDD398F2247D7A7C00B55057 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
FDD398F4247D877800B55057 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
FDD398F6247D877900B55057 /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -779,8 +779,8 @@
isa = PBXVariantGroup;
children = (
FDD398F2247D7A7C00B55057 /* Base */,
FDD398F4247D877800B55057 /* en */,
FDD398F6247D877900B55057 /* ar */,
A06681532A58BB6500B93FC6 /* en */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ class CardsDataCollectingViewController: UIViewController {

vgsCollect.textFields.forEach { textField in
textField.textColor = UIColor.inputBlackTextColor
textField.font = .systemFont(ofSize: 22)
textField.padding = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
textField.tintColor = .lightGray
/// Implement VGSTextFieldDelegate methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class CardsDataTokenizationViewController: UIViewController {

vgsCollect.textFields.forEach { textField in
textField.textColor = UIColor.inputBlackTextColor
textField.font = .systemFont(ofSize: 22)
textField.padding = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
textField.tintColor = .lightGray
/// Implement VGSTextFieldDelegate methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ class CombineExamplesViewController: UIViewController {

vgsCollect.textFields.forEach { textField in
textField.textColor = UIColor.inputBlackTextColor
textField.font = .systemFont(ofSize: 22)
textField.padding = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
textField.tintColor = .lightGray
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class CustomDataCollectingViewController: UIViewController {
customDataField.textAlignment = .center

customDataField.textColor = UIColor.inputBlackTextColor
customDataField.font = .systemFont(ofSize: 22)
customDataField.padding = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
customDataField.tintColor = .lightGray
customDataField.delegate = self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ class CustomPaymentCardsViewController: UIViewController {

vgsCollect.textFields.forEach { textField in
textField.textColor = UIColor.inputBlackTextColor
textField.font = .systemFont(ofSize: 22)
textField.padding = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
textField.tintColor = .lightGray
textField.delegate = self
Expand Down
4 changes: 3 additions & 1 deletion demoapp/demoapp/UseCases/DateValidationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,12 @@ private extension DateValidationViewController {
dateField.placeholder = "MM-DD-YYYY"
dateField.monthPickerFormat = .longSymbols

// Setup accessibility
dateField.textFieldAccessibilityLabel = "expiration date input"

/// Add logging
vgsCollect.textFields.forEach { textField in
textField.textColor = UIColor.inputBlackTextColor
textField.font = .systemFont(ofSize: 22)
textField.padding = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
textField.tintColor = .lightGray
/// Implement VGSTextFieldDelegate methods
Expand Down
1 change: 0 additions & 1 deletion demoapp/demoapp/UseCases/SSNCollectingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class SSNCollectingViewController: UIViewController {
ssnField.textAlignment = .center

ssnField.textColor = UIColor.inputBlackTextColor
ssnField.font = .systemFont(ofSize: 22)
ssnField.padding = UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
ssnField.tintColor = .lightGray
ssnField.delegate = self
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes/CardState.html
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2023 <a class="link" href="https://verygoodsecurity.com" target="_blank" rel="external noopener">Very Good Security</a>. All rights reserved. (Last updated: 2023-05-05)</p>
<p>&copy; 2023 <a class="link" href="https://verygoodsecurity.com" target="_blank" rel="external noopener">Very Good Security</a>. All rights reserved. (Last updated: 2023-07-19)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes/SSNState.html
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2023 <a class="link" href="https://verygoodsecurity.com" target="_blank" rel="external noopener">Very Good Security</a>. All rights reserved. (Last updated: 2023-05-05)</p>
<p>&copy; 2023 <a class="link" href="https://verygoodsecurity.com" target="_blank" rel="external noopener">Very Good Security</a>. All rights reserved. (Last updated: 2023-07-19)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes/State.html
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2023 <a class="link" href="https://verygoodsecurity.com" target="_blank" rel="external noopener">Very Good Security</a>. All rights reserved. (Last updated: 2023-05-05)</p>
<p>&copy; 2023 <a class="link" href="https://verygoodsecurity.com" target="_blank" rel="external noopener">Very Good Security</a>. All rights reserved. (Last updated: 2023-07-19)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes/VGSCVCTextField.html
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ <h4>Declaration</h4>
</article>
</div>
<section class="footer">
<p>&copy; 2023 <a class="link" href="https://verygoodsecurity.com" target="_blank" rel="external noopener">Very Good Security</a>. All rights reserved. (Last updated: 2023-05-05)</p>
<p>&copy; 2023 <a class="link" href="https://verygoodsecurity.com" target="_blank" rel="external noopener">Very Good Security</a>. All rights reserved. (Last updated: 2023-07-19)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</body>
Expand Down
Loading

0 comments on commit 4ff5c1d

Please sign in to comment.