Skip to content

Commit

Permalink
Merge pull request #23 from transloadit/swift-development
Browse files Browse the repository at this point in the history
Bump TUSKit version
  • Loading branch information
MMasterson authored Mar 22, 2021
2 parents f320932 + 412c751 commit 015497c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
10 changes: 5 additions & 5 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ PODS:
- FBSnapshotTestCase (~> 2.0)
- Nimble (~> 7.0)
- Quick (1.2.0)
- Transloadit (2.1.1.alpha):
- TUSKit (~> 2.1.5.alpha)
- TUSKit (2.1.5.alpha)
- Transloadit (2.1.0):
- TUSKit (~> 2.1.0)
- TUSKit (2.1.0)

DEPENDENCIES:
- FBSnapshotTestCase (~> 2.1.4)
Expand All @@ -39,8 +39,8 @@ SPEC CHECKSUMS:
Nimble: 051e3d8912d40138fa5591c78594f95fb172af37
Nimble-Snapshots: f5459b5b091678dc942d03ec4741cacb58ba4a52
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
Transloadit: 04579bc6c47e394226ad990dcd1f50988c8cf2cd
TUSKit: 848e7da5efd00aedb649e838ff968fb11dd664d5
Transloadit: 37ec9471fb4d82119bcd788e6a0305995642fd9f
TUSKit: 2fe53b42c248596a219c991096ca785997e72eb2

PODFILE CHECKSUM: c54fe98a78e285d7620018f91160940d9909bc2a

Expand Down
7 changes: 6 additions & 1 deletion Example/Transloadit/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavig

func transloaditProcessing(forObject: APIObject, withResult: TransloaditResponse) {
if (withResult.success) {
print("We did it!")
if(withResult.processing) {
print("Processing")
} else {
var assembly: Assembly = forObject as! Assembly
print("Processed")
}
} else {
print(withResult.error)
}
Expand Down
4 changes: 2 additions & 2 deletions Transloadit.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'Transloadit'
s.version = '2.0.1'
s.version = '2.0.2'
s.summary = 'A short description of Transloadit.'
s.swift_version = '5.0'

Expand Down Expand Up @@ -40,5 +40,5 @@ TODO: Add long description of the pod here.
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
s.dependency 'TUSKit', '~> 2.0.0'
s.dependency 'TUSKit', '~> 2.1.0'
end
5 changes: 1 addition & 4 deletions Transloadit/Classes/Assembly.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Assembly: APIObject {
var numberOfFiles: Int?

internal var tusUpload: TUSUpload?
internal var assemblyURL: String?
public var assemblyURL: String?


internal var steps: NSMutableDictionary = [:]
Expand All @@ -25,9 +25,6 @@ public class Assembly: APIObject {
}


public func addFile(withData: Data) {

}

public func addFile(withPathURL: URL) {
tusUpload = TUSUpload(withId: withPathURL.lastPathComponent, andFilePathURL: withPathURL, andFileType: withPathURL.pathExtension)
Expand Down
12 changes: 6 additions & 6 deletions Transloadit/Classes/TransloaditExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class TransloaditExecutor: TUSDelegate {
self.urlRequest(withMethod: "POST", andObject: object, callback: { response in
if (response.success) {
if object.isKind(of: Assembly.self) {
print(response.tusURL)
TUSClient.shared.uploadURL = URL(string: response.tusURL)
Transloadit.shared.delegate?.transloaditCreation(forObject: object as! Assembly, withResult: response)
TUSClient.shared.uploadURL = URL(string: response.tusURL)!
//TUSClient.shared.startOrResume(forUpload: (object as! Assembly).tusUpload!, withExisitingURL: "")
(object as! Assembly).tusUpload?.metadata = ["fieldname": "file-input",
"assembly_url": response.assemblyURL,
Expand All @@ -72,7 +72,7 @@ class TransloaditExecutor: TUSDelegate {

} else {
if object.isKind(of: Assembly.self) {
// Transloadit.shared.delegate?.transloaditCreationResult(forObject: object)
Transloadit.shared.delegate?.transloaditCreation(forObject: object as! Assembly, withResult: response)
}
if object.isKind(of: Template.self) {
// Transloadit.shared.delegate?.transloaditTemplateCreationError()
Expand Down Expand Up @@ -238,10 +238,10 @@ class TransloaditExecutor: TUSDelegate {
}
} catch let error as NSError {
print(error)
transloaditResponse.error = error.debugDescription
callback(transloaditResponse)

}
//let outputStr = String(data: data!, encoding: String.Encoding.utf8) as String!
// print(outputStr)


}

Expand Down

0 comments on commit 015497c

Please sign in to comment.