Skip to content

Commit 1dfa8be

Browse files
committed
Update README.md
1 parent c5e6e24 commit 1dfa8be

File tree

1 file changed

+41
-39
lines changed

1 file changed

+41
-39
lines changed

README.md

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,58 +24,60 @@ CTAssetsPickerController is an iOS controller that allows picking multiple photo
2424
Xcode 6 and iOS 8.
2525

2626
## Adding to your project
27-
###[CocoaPods](http://cocoapods.org) Podfile
28-
````
29-
platform :ios, '8.0'
30-
pod 'CTAssetsPickerController', '~> 3.0.0-beta.1'
31-
````
32-
###[Manual Setup](https://github.com/chiunam/CTAssetsPickerController/wiki/Manual-Setup-(v3))
27+
28+
1. [CocoaPods](http://cocoapods.org) Podfile
29+
30+
````
31+
platform :ios, '8.0'
32+
pod 'CTAssetsPickerController', '~> 3.0.0-beta.1'
33+
````
34+
35+
2. [Manual Setup](https://github.com/chiunam/CTAssetsPickerController/wiki/Manual-Setup-(v3))
3336
3437
3538
## Usages
3639
37-
### Import header
40+
1. Import header
3841
39-
```` objective-c
40-
#import <CTAssetsPickerController/CTAssetsPickerController.h>
41-
````
42+
```` objective-c
43+
#import <CTAssetsPickerController/CTAssetsPickerController.h>
44+
````
4245
43-
### Create and present CTAssetsPickerController
46+
2. Create and present CTAssetsPickerController
4447
45-
```` objective-c
46-
// request authorization status
47-
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status){
48-
dispatch_async(dispatch_get_main_queue(), ^{
49-
50-
// init picker
51-
CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init];
52-
53-
// set delegate
54-
picker.delegate = self;
48+
```` objective-c
49+
// request authorization status
50+
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status){
51+
dispatch_async(dispatch_get_main_queue(), ^{
52+
53+
// init picker
54+
CTAssetsPickerController *picker = [[CTAssetsPickerController alloc] init];
5555
56-
// present picker
57-
[self presentViewController:picker animated:YES completion:nil];
58-
59-
});
60-
}];
61-
````
62-
63-
### Implement didFinishPickingAssets delegate
64-
65-
If the picker is presented by `presentViewController:animated:completion:` method, the delegate is responsible for dismissing the picker when the operation completes.
66-
67-
```` objective-c
68-
- (void)assetsPickerController:(CTAssetsPickerController *)picker didFinishPickingAssets:(NSArray *)assets
69-
{
70-
// assets contains PHAsset objects.
71-
}
72-
````
56+
// set delegate
57+
picker.delegate = self;
58+
59+
// present picker
60+
[self presentViewController:picker animated:YES completion:nil];
61+
});
62+
}];
63+
````
64+
65+
3. Implement didFinishPickingAssets delegate
66+
67+
If the picker is presented by `presentViewController:animated:completion:` method, the delegate is responsible for dismissing the picker when the operation completes.
68+
69+
```` objective-c
70+
- (void)assetsPickerController:(CTAssetsPickerController *)picker didFinishPickingAssets:(NSArray *)assets
71+
{
72+
// assets contains PHAsset objects.
73+
}
74+
````
7375
7476
## Customisation
7577
7678
Customisation can be done by setting properties or implementating delegate methods. See the [demo project](https://github.com/chiunam/CTAssetsPickerController/wiki/Running-demo-app) for the details.
7779
78-
### Localisation
80+
## Localisation
7981
8082
`CTAssetsPicker.strings` contains strings used in the picker. It will be included in `CTAssetsPickerController.bundle` automatically if you add the picker to your project by using CocoaPods. You might translate the text or add your translation accordingly. PR is always welcomed if you add translation to the picker.
8183

0 commit comments

Comments
 (0)