Skip to content

Commit b6b2c4b

Browse files
Merge pull request #250 from skyflowapi/public-release/1.21.0
SK-1147 Public release/1.21.0
2 parents 705b475 + 5057089 commit b6b2c4b

27 files changed

Lines changed: 1287 additions & 45 deletions

.swiftpm/xcode/xcshareddata/xcschemes/Skyflow.xcscheme

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,16 @@
204204
ReferencedContainer = "container:">
205205
</BuildableReference>
206206
</TestableReference>
207+
<TestableReference
208+
skipped = "NO">
209+
<BuildableReference
210+
BuildableIdentifier = "primary"
211+
BlueprintIdentifier = "skyflow-iOS-composableTests"
212+
BuildableName = "skyflow-iOS-composableTests"
213+
BlueprintName = "skyflow-iOS-composableTests"
214+
ReferencedContainer = "container:">
215+
</BuildableReference>
216+
</TestableReference>
207217
</Testables>
208218
</TestAction>
209219
<LaunchAction

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ let package = Package(
3737
dependencies: ["Skyflow"]),
3838
.testTarget(name: "skyflow-iOS-elementTests",
3939
dependencies: ["Skyflow"]),
40-
.testTarget(name: "skyflow-iOS-utilTests",
40+
.testTarget(name: "skyflow-iOS-utilTests",
4141
dependencies: ["Skyflow"]),
42-
.testTarget(name: "skyflow-iOS-scenarioTests",
43-
dependencies: ["Skyflow"])
42+
.testTarget(name: "skyflow-iOS-scenarioTests",
43+
dependencies: ["Skyflow"]),
44+
.testTarget(name: "skyflow-iOS-composableTests", dependencies: ["Skyflow"])
4445
]
4546
)

Skyflow.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pod::Spec.new do |spec|
22

33
spec.name = "Skyflow"
44

5-
spec.version = "1.20.0"
5+
spec.version = "1.21.0"
66

77
spec.summary = "skyflow-iOS"
88

@@ -20,7 +20,7 @@ Pod::Spec.new do |spec|
2020

2121
spec.ios.deployment_target = "9.0"
2222

23-
spec.source = { :git => "https://github.com/skyflowapi/skyflow-iOS.git", :tag => "1.20.0" }
23+
spec.source = { :git => "https://github.com/skyflowapi/skyflow-iOS.git", :tag => "1.21.0" }
2424

2525
spec.source_files = "Sources/Skyflow/**/*.{swift}"
2626

Sources/Skyflow/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111

1212
import Foundation
1313

14-
var SDK_VERSION = "1.20.0"
14+
var SDK_VERSION = "1.21.0"

Sources/Skyflow/collect/CollectContainer.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ public extension Container {
1313
func create(input: CollectElementInput, options: CollectElementOptions? = CollectElementOptions()) -> TextField where T: CollectContainer {
1414
var tempContextOptions = self.skyflow.contextOptions
1515
tempContextOptions.interface = .COLLECT_CONTAINER
16-
let skyflowElement = TextField(input: input, options: options!, contextOptions: tempContextOptions)
16+
let skyflowElement = TextField(input: input, options: options!, contextOptions: tempContextOptions, elements: elements)
1717
elements.append(skyflowElement)
1818
let uuid = NSUUID().uuidString
1919
self.skyflow.elementLookup[uuid] = skyflowElement
2020
skyflowElement.uuid = uuid
21-
Log.info(message: .CREATED_ELEMENT, values: [input.label == "" ? "collect" : input.label], contextOptions: tempContextOptions)
21+
Log.info(message: .CREATED_ELEMENT, values: [input.label == "" ? "collect" : input.label], contextOptions: tempContextOptions)
2222
return skyflowElement
2323
}
2424

@@ -105,10 +105,10 @@ public extension Container {
105105

106106
private func checkElement(element: TextField) -> ErrorCodes? {
107107
if element.collectInput.table.isEmpty {
108-
return .EMPTY_TABLE_NAME_IN_COLLECT(value: element.collectInput.type.name)
108+
return .EMPTY_TABLE_NAME_IN_COLLECT(value: element.collectInput.type?.name ?? element.fieldType.name)
109109
}
110110
if element.collectInput.column.isEmpty {
111-
return .EMPTY_COLUMN_NAME_IN_COLLECT(value: element.collectInput.type.name)
111+
return .EMPTY_COLUMN_NAME_IN_COLLECT(value: element.collectInput.type?.name ?? element.fieldType.name)
112112
}
113113
if !element.isMounted() {
114114
return .UNMOUNTED_COLLECT_ELEMENT(value: element.collectInput.column)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2022 Skyflow
3+
*/
4+
//
5+
// Created by Bharti Sagar on 19/07/23.
6+
//
7+
8+
import Foundation
9+
10+
let ALLOWED_FOCUS_AUTO_SHIFT_ELEMENT_TYPES: [ElementType] = [
11+
.CARD_NUMBER,
12+
.EXPIRATION_DATE,
13+
.EXPIRATION_YEAR,
14+
.EXPIRATION_MONTH
15+
]

Sources/Skyflow/composable/ComposableContainer.swift

Lines changed: 329 additions & 0 deletions
Large diffs are not rendered by default.

Sources/Skyflow/core/Client.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public class Client {
9595
}
9696
}
9797

98-
public func container<T>(type: T.Type, options: ContainerOptions? = ContainerOptions()) -> Container<T>? {
98+
public func container<T>(type: T.Type, options: ContainerOptions? = nil) -> Container<T>? {
9999
if options != nil {
100100
// Set options
101101
}
@@ -109,7 +109,9 @@ public class Client {
109109
Log.info(message: .REVEAL_CONTAINER_CREATED, contextOptions: self.contextOptions)
110110
return Container<T>(skyflow: self)
111111
}
112-
112+
if T.self == ComposableContainer.self {
113+
return Container<T>(skyflow: self, options: options)
114+
}
113115
return nil
114116
}
115117

Sources/Skyflow/core/EventName.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ public enum EventName: String {
1111
case READY = "READY"
1212
case FOCUS = "FOCUS"
1313
case BLUR = "BLUR"
14+
case SUBMIT = "SUBMIT"
1415
}

Sources/Skyflow/core/InterfaceName.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import Foundation
1414
internal enum InterfaceName {
1515
case COLLECT_CONTAINER
1616
case REVEAL_CONTAINER
17+
case COMPOSABLE_CONTAINER
1718
case CLIENT
1819
case INSERT
1920
case DETOKENIZE
@@ -29,6 +30,7 @@ internal enum InterfaceName {
2930
case .DETOKENIZE: return "client detokenize"
3031
case .GETBYID: return "client getById"
3132
case .EMPTY: return ""
33+
case .COMPOSABLE_CONTAINER: return "composable container"
3234
}
3335
}
3436
}

0 commit comments

Comments
 (0)