Skip to content

AGImagePickerController is a image picker, support photos multiple choice, support zoom preview...

License

Notifications You must be signed in to change notification settings

kb100824/AGImagePickerController

 
 

Repository files navigation

AGImagePickerController(iOS应用图片选择器)

AGImagePickerController is a image picker, support photos multiple choice, to support large map slipping preview, support zoom preview, support for horizontal and vertical screen, supports all iOS devices

AGImagePickerController是一个图片选择器,支持图片多选,支持大图横滑预览,支持放大预览,支持横竖屏,支持所有的iOS设备。

Screenshot Screenshot Screenshot Screenshot Screenshot

Usage(用法)

        self.selectedPhotos = [NSMutableArray array];
        
        __block AGViewController *blockSelf = self;
        
        ipc = [AGImagePickerController sharedInstance:self];
        ipc.didFailBlock = ^(NSError *error) {
            NSLog(@"Fail. Error: %@", error);
            
            if (error == nil) {
                [blockSelf.selectedPhotos removeAllObjects];
                NSLog(@"User has cancelled.");
                
                [blockSelf dismissModalViewControllerAnimated:YES];
            } else {
                
                // We need to wait for the view controller to appear first.
                double delayInSeconds = 0.5;
                dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
                dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
                    [blockSelf dismissModalViewControllerAnimated:YES];
                });
            }
            
            [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
            
        };
        ipc.didFinishBlock = ^(NSArray *info) {
            [blockSelf.selectedPhotos setArray:info];
            
            NSLog(@"Info: %@", info);
            [blockSelf dismissModalViewControllerAnimated:YES];
            
            [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];
        };

Contact(联系)

About

AGImagePickerController is a image picker, support photos multiple choice, support zoom preview...

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 99.3%
  • Ruby 0.7%