Skip to content

Commit c025768

Browse files
committed
DEX-292 feat: added comments to iOS SDK
1 parent c83e284 commit c025768

26 files changed

Lines changed: 128 additions & 128 deletions

Sources/Skyflow/collect/CollectContainer.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
import Foundation
88
import UIKit
99

10-
/// This is the description for CollectContainer Class
10+
/// Wraps all Collect Elements.
1111
public class CollectContainer: ContainerProtocol {}
1212

1313
public extension Container {
1414

1515
/**
16-
This is the description for create method.
16+
Creates a Collect Element.
1717

1818
- Parameters:
19-
- input: This is the description for input parameter.
20-
- options: This is the description for options parameter.
19+
- input: Collect Element input.
20+
- options: Collect Element options.
2121

22-
- Returns: This is the description of what method returns.
22+
- Returns: Returns the Collect Element.
2323
*/
2424
func create(input: CollectElementInput, options: CollectElementOptions? = CollectElementOptions()) -> TextField where T: CollectContainer {
2525
var tempContextOptions = self.skyflow.contextOptions
@@ -34,11 +34,11 @@ public extension Container {
3434
}
3535

3636
/**
37-
This is the description for collect method.
37+
Collects the data and sends it to the vault.
3838

3939
- Parameters:
40-
- callback: This is the description for callback parameter.
41-
- options: This is the description for options parameter.
40+
- callback: Implementation of Skyflow.Callback.
41+
- options: Collects the data and sends it to the vault.
4242
*/
4343
func collect(callback: Callback, options: CollectOptions? = CollectOptions()) where T: CollectContainer {
4444
var tempContextOptions = self.skyflow.contextOptions

Sources/Skyflow/collect/CollectOptions.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

77
import Foundation
88

9-
/// This is the description for CollectOptions Class
9+
/// Options for a Collect Element.
1010
public struct CollectOptions {
1111
var tokens: Bool
1212
var additionalFields: [String: Any]?
1313
var upsert: [[String: Any]]?
1414

1515
/**
16-
This is the description for container method.
16+
Initializes the Collect options.
1717

1818
- Parameters:
19-
- tokens: This is the description for tokens parameter.
20-
- additionalFields: This is the description for additionalFields parameter.
21-
- upsert: This is the description for upsert paramter.
19+
- tokens: If `true`, returns tokens for the collected data. Defaults to `true`.
20+
- additionalFields: Additional, non-sensitive data to insert into the vault.
21+
- upsert: Upsert configuration for the element.
2222
*/
2323
public init(tokens: Bool = true, additionalFields: [String: Any]? = nil, upsert: [[String: Any]]? = nil) {
2424
self.tokens = tokens

Sources/Skyflow/collect/InsertOptions.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
import Foundation
88

9-
/// This is the description for InsertOptions Class
9+
/// Contains additional parameters for the insert method.
1010
public struct InsertOptions {
1111
var tokens: Bool
1212
var upsert: [[String: Any]]?
1313

1414
/**
15-
This is the description for container method.
15+
Initializes the Insert options.
1616

1717
- Parameters:
18-
- tokens: This is the description for tokens parameter.
19-
- upsert: This is the description for upsert parameter.
18+
- tokens: If `true`, returns tokens for the collected data. Defaults to `false`.
19+
- upsert: If specified, upserts data. If not specified, inserts data.
2020
*/
2121
public init(tokens: Bool = true, upsert: [[String: Any]]? = nil) {
2222
self.tokens = tokens

Sources/Skyflow/core/Client.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public class Client {
1616
var elementLookup: [String: Any] = [:]
1717

1818
/**
19-
This is the description for init method.
19+
Initializes the Skyflow client.
2020

2121
- Parameters:
22-
- skyflowConfig: This is the description for skyflowConfig parameter.
22+
- skyflowConfig: Configuration for the Skyflow client.
2323
*/
2424
public init(_ skyflowConfig: Configuration) {
2525
self.vaultID = skyflowConfig.vaultID
@@ -30,12 +30,12 @@ public class Client {
3030
}
3131

3232
/**
33-
This is the description for insert method.
33+
Inserts data into the vault.
3434

3535
- Parameters:
36-
- records: This is the description for records parameter.
37-
- options: This is the description for options parameter.
38-
- callback: This is the description for callback parameter.
36+
- records: Records to insert.
37+
- options: Options for the insertion.
38+
- callback: Implementation of Skyflow.Callback.
3939
*/
4040
public func insert(records: [String: Any], options: InsertOptions = InsertOptions(), callback: Callback) {
4141
var tempContextOptions = self.contextOptions
@@ -111,13 +111,13 @@ public class Client {
111111
}
112112

113113
/**
114-
This is the description for container method.
114+
Creates a container.
115115

116116
- Parameters:
117-
- type: This is the description for type parameter.
118-
- options: This is the description for options parameter.
117+
- type: Type of the container.
118+
- options: Options for the container.
119119

120-
- Returns: This is the description of what method returns.
120+
- Returns: Returns a container of the specified type.
121121
*/
122122
public func container<T>(type: T.Type, options: ContainerOptions? = ContainerOptions()) -> Container<T>? {
123123
if options != nil {
@@ -138,12 +138,12 @@ public class Client {
138138
}
139139

140140
/**
141-
This is the description for detokenize method.
141+
Returns values that correspond to the specified tokens.
142142

143143
- Parameters:
144-
- records: This is the description for records parameter.
145-
- options: This is the description for options parameter.
146-
- callback: This is the description for callback paramter.
144+
- records: Records to fetch.
145+
- options: Additional options for the reveal method.
146+
- callback: Implementation of Skyflow.Callback.
147147
*/
148148
public func detokenize(records: [String: Any], options: RevealOptions? = RevealOptions(), callback: Callback) {
149149
var tempContextOptions = self.contextOptions
@@ -210,11 +210,11 @@ public class Client {
210210
}
211211

212212
/**
213-
This is the description for getById method.
213+
Reveal records by Skyflow ID.
214214

215215
- Parameters:
216216
- records: This is the description for records parameter.
217-
- callback: This is the description for callback paramter.
217+
- callback: Implementation of Skyflow.Callback.
218218
*/
219219
public func getById(records: [String: Any], callback: Callback) {
220220
var tempContextOptions = self.contextOptions

Sources/Skyflow/core/Configuration.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import Foundation
88

9-
/// This is the description for Configuration method.
9+
/// Configuration for the Skyflow client.
1010
public struct Configuration {
1111
var vaultID: String
1212
var vaultURL: String
@@ -17,10 +17,10 @@ public struct Configuration {
1717
This is the description for init method.
1818

1919
- Parameters:
20-
- vaultID: This is the description for vaultID parameter.
21-
- vaultURL: This is the description for vaultURL parameter.
22-
- tokenProvider: This is the description for tokenProvider paramter.
23-
- options: This is the description for options parameter.
20+
- vaultID: ID of the vault to connect to.
21+
- vaultURL: URL of the vault to connect to.
22+
- tokenProvider: An implementation of the token provider interface.
23+
- options: Additional options for configuration.
2424
*/
2525
public init(vaultID: String = "", vaultURL: String = "", tokenProvider: TokenProvider, options: Options? = Options()) {
2626
self.vaultID = vaultID

Sources/Skyflow/core/Env.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import Foundation
88

9-
/// This is the description for Env enum.
9+
/// Supported environments.
1010
public enum Env {
1111
case DEV
1212
case PROD

Sources/Skyflow/core/EventName.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import Foundation
88

9-
/// This is the description for EventName enum.
9+
/// Supported event names.
1010
public enum EventName: String {
1111
case CHANGE = "CHANGE"
1212
case READY = "READY"

Sources/Skyflow/core/Init.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import Foundation
88

99
/**
10-
This is the description for initialize method.
10+
Initializes the Skyflow client.
1111

1212
- Parameters:
13-
- skyflowConfig: This is the description for skyflowConfig parameter.
13+
- skyflowConfig: Configuration for the Skyflow client.
1414

15-
- Returns: This is the description of what method returns.
15+
- Returns: Returns an instance of the Skyflow client.
1616
*/
1717
public func initialize(_ skyflowConfig: Configuration) -> Client {
1818
return Client(skyflowConfig)

Sources/Skyflow/core/LogLevel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import Foundation
88

9-
/// This is the description for LogLevel enum.
9+
/// Supported log levels.
1010
public enum LogLevel: Int {
1111
case DEBUG = 0
1212
case INFO = 1

Sources/Skyflow/core/Options.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
/// Object that describes the options parameter
66

77
public struct Options {
8-
/// This is the description for logLevel property.
8+
/// Log level to apply.
99
var logLevel: LogLevel
10-
/// This is the description for env property.
10+
/// Type of environment.
1111
var env: Env
1212

1313
/**
14-
This is the description for init method.
14+
Initializes the Skyflow client.
1515

1616
- Parameters:
17-
- logLevel: This is the description for logLevel parameter.
18-
- env: This is the description for env parameter.
17+
- logLevel: Log level to apply.
18+
- env: Type of environment.
1919
*/
2020
public init(logLevel: LogLevel = .ERROR, env: Env = .PROD) {
2121
self.logLevel = logLevel

0 commit comments

Comments
 (0)