Skip to content

Commit

Permalink
Removing the set representation option method that used va_list param…
Browse files Browse the repository at this point in the history
…eters to support the swift bridge, changing the method to an NSSet parameter. For consitentcy we should follow up migrating the objc set represetation option method as well. (#541) (#542)
  • Loading branch information
jdizoglio committed Jun 13, 2018
1 parent 780fe41 commit 6deb770
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion BoxContentSDK/BoxContentSDK/Requests/BOXFileRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ typedef NS_OPTIONS(NSUInteger, BOXRepresentationRequestOptions) {
*/
- (void)setRepresentationRequestOptions:(BOXRepresentationRequestOptions)representationOptions, ...;

- (void)setRepresentationRequestOptions:(BOXRepresentationRequestOptions)representationOptions args:(va_list)args;
- (void)setRepresentationRequestOptionsWithSet:(NSSet *)representationOptionsSet;

- (NSString *)formatRepresentationRequestHeader;

Expand Down
16 changes: 2 additions & 14 deletions BoxContentSDK/BoxContentSDK/Requests/BOXFileRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,9 @@ - (void)setRepresentationRequestOptions:(BOXRepresentationRequestOptions)represe
self.representationsRequested = [[NSMutableOrderedSet alloc] initWithArray:arguments];
}

// Swift compatable va_list version of the method
- (void)setRepresentationRequestOptions:(BOXRepresentationRequestOptions)representationOptions args:(va_list)argumentList
- (void)setRepresentationRequestOptionsWithSet:(NSSet *)representationOptionsSet
{
NSMutableArray *arguments=[[NSMutableArray alloc]init];
BOXRepresentationRequestOptions eachObject;
if (representationOptions) {
[arguments addObject: [NSNumber numberWithUnsignedInteger:representationOptions]];
while ((eachObject = va_arg(argumentList, BOXRepresentationRequestOptions))) {
if (eachObject > 0) {
[arguments addObject: [NSNumber numberWithUnsignedInteger:eachObject]];
}
}
}

self.representationsRequested = [[NSMutableOrderedSet alloc] initWithArray:arguments];
self.representationsRequested = [[NSMutableOrderedSet alloc] initWithSet:representationOptionsSet];
}

- (NSString *)formatRepresentationRequestHeader
Expand Down

0 comments on commit 6deb770

Please sign in to comment.