Skip to content

Commit

Permalink
Updating instructions on how to instantiate TransformationsUI and p…
Browse files Browse the repository at this point in the history
…ass an existing `Filestack.Client` object.

Bumping version to 1.3.0.
  • Loading branch information
rnine committed Apr 30, 2021
1 parent a7215c0 commit 9944830
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,25 @@ To install our Swift Package, please follow the steps below:
import TransformationsUI
```

2. Instantiate `TransformationsUI` and set delegate
2. Instantiate `TransformationsUI` passing a `Filestack.Client` and set delegate

```swift
let transformationsUI = TransformationsUI()
let fsConfig = Filestack.Config.builder
.with(callbackURLScheme: "transformationsuidemo")
.with(imageURLExportPreset: .current)
.with(maximumSelectionLimit: 1)
.with(documentPickerAllowedUTIs: ["public.image"])
.with(cloudSourceAllowedUTIs: ["public.image"])
.build()

let policy = Policy(expiry: .distantFuture,
call: [.pick, .read, .stat, .write, .writeURL, .store, .convert, .remove, .exif])

let security = try FilestackSDK.Security(policy: policy, appSecret: "YOUR-APP-SECRET")
let fsClient = Filestack.Client(apiKey: "YOUR-API-KEY", security: security, config: fsConfig)
let config = try Config(modules: modules, fsClient: fsClient)

let transformationsUI = TransformationsUI(with: config)
transformationsUI.delegate = self
```

Expand Down Expand Up @@ -139,11 +154,7 @@ Below you will find an exhaustive list of configurable properties and commands p

| Property | Purpose | Example |
|---|---|---|
| `filestackAPIKey` | Filestack's API key required to pick images using Filestack's picker.| `"YOUR-API-KEY-HERE"` |
| `filestackAppSecret` | Filestack's APP secret required to pick images using Filestack's picker.| `"YOUR-APP-SECRET"` |
| `callbackURLScheme` | Required by Filestack's picker to complete the cloud provider's authentication flow (only required if any cloud sources are available.)| `"transformationsuidemo"` |
| `availableCloudSources` | The list of [cloud sources](https://filestack.github.io/filestack-ios/Classes/CloudSource.html) available to Filestack's picker.| `[.dropbox, .googleDrive, .googlePhotos]` |
| `availableLocalSources` | The list of [local sources](https://filestack.github.io/filestack-ios/Classes/LocalSource.html) available to Filestack's picker.| `[.camera, .photoLibrary, .documents]` |
| `fsClient` | Filestack's client *(read-only)* | N/A |

### Border Module

Expand Down
2 changes: 1 addition & 1 deletion Sources/TransformationsUI/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.3.0

0 comments on commit 9944830

Please sign in to comment.