You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -56,7 +56,7 @@ You can of course also just include this framework manually into your project by
56
56
Simply add this line to your Cartfile:
57
57
58
58
```
59
-
github "Flinesoft/CSVImporter" ~> 1.6
59
+
github "Flinesoft/CSVImporter" ~> 1.7
60
60
```
61
61
62
62
And run `carthage update`. Then drag & drop the HandySwift.framework in the Carthage/build folder to your project. Also do the same with the dependent framework `HandySwift`. Now you can `import CSVImporter` in each class you want to use its features. Refer to the [Carthage README](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) for detailed / updated instructions.
@@ -71,7 +71,7 @@ platform :ios, '8.0'
71
71
use_frameworks!
72
72
73
73
target 'MyAppTarget'do
74
-
pod 'CSVImporter', '~> 1.6'
74
+
pod 'CSVImporter', '~> 1.7'
75
75
end
76
76
```
77
77
@@ -128,6 +128,16 @@ let path = "path/to/your/CSV/file"
128
128
let importer = CSVImporter<[String]>(path: path, workQosClass: .background, callbacksQosClass: .utility)
129
129
```
130
130
131
+
### Import Synchronously
132
+
133
+
If you know your file is small enough or blocking the UI is not a problem, you can also use the synchronous import methods to import your data. Simply call `importRecords` instead of `startImportingRecords` and you will receive the end result (the same content as in the `onFinish` closure when using `startImportingRecords`) directly:
134
+
135
+
```Swift
136
+
let importedRecords = importer.importRecords { $0 }
137
+
```
138
+
139
+
Note that this method doesn't have any option to get notified about progress or failure – you just get the result. Check if the resulting array is empty to recognize potential failures.
140
+
131
141
### Easy data mapping
132
142
133
143
As stated above the default type is a `[String]` but you can provide whatever type you like. For example, let's say you have a class like this
0 commit comments