iOS modal view for selecting photos from a user's albums. Allows the caller to specify a delegate as well as the maximum number of pictures the user can select. The delegate receives a message containing the selected set of FBGraphObjects when the user has finished selecting their photos.
-(void)showPhotoPicker {
EasyFacebookPhotoPicker *picker = [[EasyFacebookPhotoPicker alloc] init];
picker.delegate = self;
picker.maxPicturesToSelect = 3;
[self presentViewController:picker animated:YES completion:^{}];
}
-(void)photoPicker:(EasyFacebookPhotoPicker *)picker finishedWithSelectedPhotos:(NSSet *)selected
{
self.selectedPhotosTextView.text = [selected.allObjects componentsJoinedByString:@", "];
}
-
Clone the repository and related dependencies
git clone https://github.com/greenwoodcm/EasyFacebookPhotoPicker.git cd EasyFacebookPhotoPicker git submodule update --init
-
Drag the
EasyFacebookPhotoPicker
directory into your project to import classes, XIBs, and image assets -
Install dependencies
- Drag the
Vendor/SDWebImage/SDWebImage.xcodeproj
project into your project - In Build Phases, under "Target Dependencies", add the SDWebImage libary
- In Build Phases, under "Link Binary with Libraries", add libSDWebImage.a and ImageIO.framework
- In Build Settings, add "-ObjC" to "Other Linker Flags"
- Drag the
Vendor/FacebookSDK.framework
folder into your project
- Drag the
-
Add Facebook app information to your plist file
- Add the FacebookDisplayName
- Add your app ID in "FacebookAppID"
- Add your app ID in "URL types/Item 0/URL schemes/Item 0" (be sure to leave the leading "fb" string)
-
Import the header in your own class -
#import "EasyFacebookPhotoPicker/EasyFacebookPhotoPicker.h"