Skip to content

Commit

Permalink
already created file example && updated podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
MMasterson committed Feb 19, 2019
1 parent a4cec38 commit 4cffefe
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ EXTERNAL SOURCES:
:path: "../"

SPEC CHECKSUMS:
TUSKit: 706a5c07afbe7bd2996a7b0ee0ddf41fe86b14bd
TUSKit: 770aeec9a2f698e84da207b98b7ae965b7958a34

PODFILE CHECKSUM: 55e2236f96d79d0c0d04ac02571d179181dfa764

COCOAPODS: 1.6.0
COCOAPODS: 1.5.0
13 changes: 12 additions & 1 deletion Example/TUSKit/TKViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ -(void)viewDidLoad
upload.failureBlock = failureBlock;
}
[self.tusSession resumeAll];

}

- (void)viewDidAppear:(BOOL)animated {
Expand Down Expand Up @@ -105,14 +106,24 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
NSLog(@"%li", (long)error.code);
}

// Initiate the background transfer
// If a file has not been created yet by your TUS backend
TUSResumableUpload *upload = [self.tusSession createUploadFromFile:fileUrl headers:@{} metadata:@{}];

upload.progressBlock = progressBlock;
upload.resultBlock = resultBlock;
upload.failureBlock = failureBlock;

[upload resume];

// //If a file has been created by your TUS backend, and you simply need to upload the data
// NSURL *urlForAlreadyCreatedFile = [[NSURL alloc] initWithString:@"URL_HERE"];
// TUSResumableUpload *uploadToAleadyCreatedFile = [self.tusSession createUploadFromFile:fileUrl headers:@{} metadata:@{} uploadUrl:urlForAlreadyCreatedFile ];
//
// uploadToAleadyCreatedFile.progressBlock = progressBlock;
// uploadToAleadyCreatedFile.resultBlock = resultBlock;
// uploadToAleadyCreatedFile.failureBlock = failureBlock;
//
// [uploadToAleadyCreatedFile resume];

}];
}
Expand Down
2 changes: 1 addition & 1 deletion TUSKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "TUSKit"
s.version = "1.3.12"
s.version = "1.3.13"
s.summary = "The tus client for iOS."
s.description = <<-DESC
An iOS implementation of the tus resumable video upload protocol.
Expand Down

0 comments on commit 4cffefe

Please sign in to comment.