Skip to content

Commit

Permalink
Merge pull request #45 from tus/develop
Browse files Browse the repository at this point in the history
Patch for Issue #44
  • Loading branch information
MMasterson committed May 10, 2019
2 parents 95320a6 + f370058 commit b7517f9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Example/TUSKit/TKViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
}

// If a file has not been created yet by your TUS backend
TUSResumableUpload *upload = [self.tusSession createUploadFromFile:fileUrl retry:-1 headers:@{} metadata:@{}];
TUSResumableUpload *upload = [self.tusSession createUploadFromFile:fileUrl retry:-1 headers:@{} metadata:@{} uploadUrl:[[NSURL alloc] initWithString:@""]];

upload.progressBlock = progressBlock;
upload.resultBlock = resultBlock;
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.4.0"
s.version = "1.4.1"
s.summary = "The tus client for iOS."
s.description = <<-DESC
An iOS implementation of the tus resumable video upload protocol.
Expand Down
1 change: 1 addition & 0 deletions TUSKit/TUSResumableUpload+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@

- (instancetype _Nullable)initWithUploadId:(NSString * _Nonnull)uploadId
file:(NSURL * _Nonnull)fileUrl
retry:(int)retryCount
delegate:(id <TUSResumableUploadDelegate> _Nonnull)delegate
uploadHeaders:(NSDictionary <NSString *, NSString *>* _Nonnull)headers
metadata:(NSDictionary <NSString *, NSString *>* _Nullable)metadata
Expand Down
2 changes: 2 additions & 0 deletions TUSKit/TUSResumableUpload.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ @implementation TUSResumableUpload

- (instancetype _Nullable)initWithUploadId:(NSString * _Nonnull)uploadId
file:(NSURL * _Nonnull)fileUrl
retry:(int)retryCount
delegate:(id <TUSResumableUploadDelegate> _Nonnull)delegate
uploadHeaders:(NSDictionary <NSString *, NSString *>* _Nonnull)headers
metadata:(NSDictionary <NSString *, NSString *>* _Nullable)metadata
Expand All @@ -131,6 +132,7 @@ - (instancetype _Nullable)initWithUploadId:(NSString * _Nonnull)uploadId

return [self initWithUploadId:uploadId
file:fileUrl
retry:retryCount
delegate:delegate
uploadHeaders:headers
finalMetadata:uploadMetadata
Expand Down
3 changes: 2 additions & 1 deletion TUSKit/TUSSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
This is NOT yet thread safe.
*/
@interface TUSSession : NSObject
@property BOOL allowsCellularAccess;
@property (nonatomic) BOOL allowsCellularAccess;

/**
Initialize
Expand All @@ -36,6 +36,7 @@
Create an upload with a uploadUrl
*/
- (TUSResumableUpload * _Nullable) createUploadFromFile:(NSURL * _Nonnull)fileURL
retry:(int)retryCount
headers:(NSDictionary <NSString *, NSString *> * __nullable)headers
metadata:(NSDictionary <NSString *, NSString *> * __nullable)metadata
uploadUrl:(NSURL * _Nonnull)uploadUrl;
Expand Down
2 changes: 2 additions & 0 deletions TUSKit/TUSSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ - (TUSResumableUpload *) createUploadFromFile:(NSURL *)fileURL
}

- (TUSResumableUpload * _Nullable) createUploadFromFile:(NSURL * _Nonnull)fileURL
retry:(int)retryCount
headers:(NSDictionary <NSString *, NSString *> * __nullable)headers
metadata:(NSDictionary <NSString *, NSString *> * __nullable)metadata
uploadUrl:(NSURL * _Nonnull)uploadUrl
{
TUSResumableUpload *upload = [[TUSResumableUpload alloc] initWithUploadId:[self.store generateUploadId]
file:fileURL
retry:retryCount
delegate:self
uploadHeaders:headers?:@{}
metadata:metadata
Expand Down

0 comments on commit b7517f9

Please sign in to comment.