This repository has been archived by the owner on Feb 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Add support for configuring page size of a pull operation
- Loading branch information
1 parent
84fb0c2
commit 0c31aa3
Showing
8 changed files
with
248 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// ---------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// ---------------------------------------------------------------------------- | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
/// Settings that control the pull behavior | ||
@interface MSPullSettings : NSObject | ||
|
||
#pragma mark * Properties | ||
|
||
///@name Properties that control pull behavior | ||
///@{ | ||
|
||
/// Size of pages requested from the server while performing a pull | ||
@property (nonatomic) NSInteger pageSize; | ||
|
||
///@} | ||
|
||
#pragma mark * Class methods | ||
|
||
///@name Class factory methods | ||
|
||
/// Class factory method for getting default pull settings | ||
+ (MSPullSettings *)default; | ||
|
||
///} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// ---------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// ---------------------------------------------------------------------------- | ||
|
||
#import "MSPullSettings.h" | ||
|
||
#pragma mark * MSPullSettings Implementation | ||
|
||
@implementation MSPullSettings | ||
|
||
NSInteger const defaultPageSize = 50; | ||
|
||
@synthesize pageSize = _pageSize; | ||
|
||
#pragma mark * Initializer method(s) | ||
|
||
- (id)init { | ||
self = [super init]; | ||
if (self) { | ||
_pageSize = defaultPageSize; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
#pragma mark * Accessor method(s) | ||
|
||
- (void)setPageSize:(NSInteger)pageSize { | ||
if (pageSize <= 0) { | ||
_pageSize = defaultPageSize; | ||
} | ||
else { | ||
_pageSize = pageSize; | ||
} | ||
} | ||
|
||
#pragma mark * Class factory method(s) | ||
|
||
+ (MSPullSettings *)default { | ||
return [MSPullSettings new]; | ||
} | ||
|
||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters