Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ca7959
commit 5e47cc6
Showing
9 changed files
with
97 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// CTCustomFetchViewController.h | ||
// CTAssetsPickerDemo | ||
// | ||
// Created by Felix Dumit on 4/5/16. | ||
// Copyright © 2016 Clement T. All rights reserved. | ||
// | ||
|
||
#import "CTBasicViewController.h" | ||
|
||
@interface CTCustomFetchViewController : CTBasicViewController | ||
|
||
@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,36 @@ | ||
// | ||
// CTCustomFetchViewController.m | ||
// CTAssetsPickerDemo | ||
// | ||
// Created by Felix Dumit on 4/5/16. | ||
// Copyright © 2016 Clement T. All rights reserved. | ||
// | ||
|
||
#import "CTCustomFetchViewController.h" | ||
|
||
@implementation CTCustomFetchViewController | ||
|
||
- (void)pickAssets:(id)sender { | ||
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) { | ||
dispatch_async(dispatch_get_main_queue(), ^{ | ||
// init picker | ||
CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init]; | ||
|
||
// set delegate | ||
picker.delegate = self; | ||
|
||
// set custom fetch | ||
picker.pickFromFetch = [PHAsset fetchAssetsWithOptions:nil]; | ||
|
||
// to present picker as a form sheet in iPad | ||
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) picker.modalPresentationStyle = UIModalPresentationFormSheet; | ||
|
||
// present picker | ||
[self presentViewController:picker | ||
animated:YES | ||
completion:nil]; | ||
}); | ||
}]; | ||
} | ||
|
||
@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