// Install via Swift Package Manager: // dependencies: [ // .package(url: "https://github.com/transloadit/TransloaditKit", .upToNextMajor(from: "3.0.0")) // ]} // Auth let credentials = Credentials(key: "YOUR_TRANSLOADIT_KEY") // Init let transloadit = Transloadit(credentials: credentials, session: "URLSession.shared") // Add files to upload let filesToUpload: [URL] = ... // Execute let assembly = transloadit.assembly(steps: [_originalStep, resizedStep, optimizeStep, exportedStep], 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)") }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter