A clone of the UIImagePickerController using the Assets Library Framework allowing for multiple asset selection
1.65k
stars
469
forks
source link
how to implement ELCImagePickerController Delegate method in Swift 3.0? #139
Open
tamilanmanikandan opened 7 years ago
(void)elcImagePickerController:(ELCImagePickerController )picker didFinishPickingMediaWithInfo:(NSArray )info { [self dismissViewControllerAnimated:YES completion:nil];
for (UIView *v in [_scrollView subviews]) { [v removeFromSuperview]; }
CGRect workingFrame = _scrollView.frame; workingFrame.origin.x = 0;
NSMutableArray images = [NSMutableArray arrayWithCapacity:[info count]]; for (NSDictionary dict in info) { if ([dict objectForKey:UIImagePickerControllerMediaType] == ALAssetTypePhoto){ if ([dict objectForKey:UIImagePickerControllerOriginalImage]){ UIImage* image=[dict objectForKey:UIImagePickerControllerOriginalImage]; [images addObject:image];
}
self.chosenImages = images;
[_scrollView setPagingEnabled:YES]; [_scrollView setContentSize:CGSizeMake(workingFrame.origin.x, workingFrame.size.height)]; }