From 38e907fa8f3f875c25d1551907d1daf5cae09542 Mon Sep 17 00:00:00 2001 From: "Mark R. Masterson" Date: Sun, 6 Dec 2020 21:15:59 -0800 Subject: [PATCH] add custom param with string value --- Example/Transloadit/ViewController.swift | 2 ++ Transloadit.podspec | 2 +- Transloadit/Classes/Assembly.swift | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Example/Transloadit/ViewController.swift b/Example/Transloadit/ViewController.swift index dd70d2a..0a8499f 100644 --- a/Example/Transloadit/ViewController.swift +++ b/Example/Transloadit/ViewController.swift @@ -42,6 +42,8 @@ class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavig assembly.addStep(name: "resize", options: newSteps) assembly.addCustomParam(key: "Custom", dictionary: ["TestKey": "TestValue"]) + assembly.addCustomParam(key: "Custom2", string: "TestValue2") + assembly.addFile(withPathURL: imageURL as! URL) assembly.save() diff --git a/Transloadit.podspec b/Transloadit.podspec index b987382..b3baca5 100644 --- a/Transloadit.podspec +++ b/Transloadit.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'Transloadit' - s.version = '2.1.2.alpha' + s.version = '2.1.3.alpha' s.summary = 'A short description of Transloadit.' s.swift_version = '5.0' diff --git a/Transloadit/Classes/Assembly.swift b/Transloadit/Classes/Assembly.swift index d4369c9..a2133bc 100644 --- a/Transloadit/Classes/Assembly.swift +++ b/Transloadit/Classes/Assembly.swift @@ -42,6 +42,10 @@ public class Assembly: APIObject { custom[key] = dictionary } + public func addCustomParam(key: String, string: String) { + custom[key] = string + } + public func save() { Transloadit.shared.invoke(assembly: self)