Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/transloadit/transloaditkit
An iOS and macOS integration for Transloadit's file uploading and encoding service
https://github.com/transloadit/transloaditkit
encoding ios macos osx sdk transloadit uploading
Last synced: about 2 months ago
JSON representation
An iOS and macOS integration for Transloadit's file uploading and encoding service
- Host: GitHub
- URL: https://github.com/transloadit/transloaditkit
- Owner: transloadit
- Created: 2016-08-30T16:19:56.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-04-03T14:54:47.000Z (9 months ago)
- Last Synced: 2024-04-14T12:59:54.955Z (9 months ago)
- Topics: encoding, ios, macos, osx, sdk, transloadit, uploading
- Language: Swift
- Homepage: https://transloadit.com/docs/#sdks
- Size: 800 KB
- Stars: 15
- Watchers: 10
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# TransloaditKit
An **iOS** and **macOS** integration for [Transloadit](https://transloadit.com)'s file uploading and encoding service
## Install
### CocoaPods
```ruby
pod 'Transloadit', '~> 3.0'
```### Swift Package Manager
```swift
dependencies: [
.package(url: "https://github.com/transloadit/TransloaditKit", .upToNextMajor(from: "3.0.0"))
]
```## Usage
Start by initializing `Transloadit`.
```swift
let credentials = Transloadit.Credentials(key: "SomeKey", secret: "SomeSecret")
let transloadit = Transloadit(credentials: credentials, session: URLSession.shared)
```### Create an Assembly
To create an `Assembly` you invoke `createAssembly(steps:andUpload:completion)` on `Transloadit`.
It returns a `TransloaditPoller` that you can use to poll for the `AssemblyStatus` of your `Assembly`.```swift
let resizeStep = Step(
name: "resize",
robot: "/image/resize",
options: [
"width": 200,
"height": 100,
"resize_strategy": "fit",
"result": true])
let filesToUpload: [URL] = ...
transloadit.createAssembly(steps: [resizeStep], andUpload: filesToUpload) { result in
switch result {
case .success(let assembly):
print("Retrieved \(assembly)")
case .failure(let error):
print("Assembly error \(error)")
}
}.pollAssemblyStatus { result in
switch result {
case .success(let assemblyStatus):
print("Received assemblystatus \(assemblyStatus)")
case .failure(let error):
print("Caught polling error \(error)")
}
}
```