Code Monkey home page Code Monkey logo

bukimagepickercontroller's Introduction

BUKImagePickerController

CI Status Version License Platform

BUKImagePickerController is a view controller that allows the user picking multiple assets from the photo libray or capturing images with a camera. It looks like the system built-in component UIImagePickerController at first glance . However, BUKImagePickerController is more powerful. Run the example project to take a tour.

screenshot

Usage

Basic

It's super easy to use BUKImagePickerController. The normal approach is:

  1. Implement BUKImagePickerControllerDelegate methods.
  2. Simply create a BUKImagePickerController instance.
  3. Set its delegate and configure it according to you actual needs.
  4. Show the image picker controller.
BUKImagePickerController *imagePickerController = [[BUKImagePickerController alloc] init];
imagePickerController.mediaType = BUKImagePickerControllerMediaTypeImage;
imagePickerController.sourceType = BUKImagePickerControllerSourceTypeLibrary;
imagePickerController.delegate = self;
imagePickerController.allowsMultipleSelection = YES;
[self presentViewController:imagePickerController animated:YES completion:nil];

In your delegate:

- (void)buk_imagePickerController:(BUKImagePickerController *)imagePickerController didFinishPickingAssets:(NSArray *)assets {
    // Process assets

    [imagePickerController dismissViewControllerAnimated:YES completion:nil];
}

Advanced

Run the example project and see the full documentation for more details.

Requirements

  • iOS 7.0 and later
  • ARC

Installation

BUKImagePickerController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "BUKImagePickerController"

Credits

Inspired by QBImagePicker

Author

Yiming Tang, @yiming_t

License

BUKImagePickerController is available under the MIT license. See the LICENSE file for more info.

bukimagepickercontroller's People

Contributors

yimingtang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bukimagepickercontroller's Issues

Version 0.2

  • Placeholder view
  • Toolbar view
  • Photos.framework
  • Authentication
  • More options

crash

  1. I create a view controller on storyboard
  2. I assign that viewcontroller's class to BUKImagePickerController
  3. I run the application. The camera roll item appears. I click on it. It crashes with this error:

the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.
The relevant UICollectionViewFlowLayout instance is <UICollectionViewFlowLayout: 0x7fe172d52e10>, and it is attached to <UICollectionView: 0x7fe17302b000; frame = (0 0; 414 736); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x7fe172c12220>; layer = <CALayer: 0x7fe172c17d10>; contentOffset: {0, 0}; contentSize: {0, 0}> collection view layout: <UICollectionViewFlowLayout: 0x7fe172d52e10>.
2016-06-24 19:54:07.524 CameraMagicNew[1915:1255483] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.
2016-06-24 19:54:07.561 CameraMagicNew[1915:1255483] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan inf]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010b67fd85 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010ad6ddeb objc_exception_throw + 48
2 CoreFoundation 0x000000010b67fcbd +[NSException raise:format:] + 205
3 QuartzCore 0x000000010f8f2e4a _ZN2CA5Layer12set_positionERKNS_4Vec2IdEEb + 152
4 QuartzCore 0x000000010f8f2fbd -[CALayer setPosition:] + 44
5 UIKit 0x000000010ca18d82 -[UICollectionViewLayoutAttributes frame] + 195
6 UIKit 0x000000010ca48eb3 -[UICollectionViewData _setLayoutAttributes:atGlobalItemIndex:] + 149
7 UIKit 0x000000010ca4bb08 -[UICollectionViewData layoutAttributesForItemAtIndexPath:] + 445
8 UIKit 0x000000010c9fd684 -[UICollectionView scrollToItemAtIndexPath:atScrollPosition:animated:] + 241
9 BUKImagePickerController 0x000000010a886a67 -[BUKAssetsViewController scrollToLatestPhotos] + 519
10 BUKImagePickerController 0x000000010a88479b -[BUKAssetsViewController viewWillAppear:] + 107
11 UIKit 0x000000010c3172bd -[UIViewController _setViewAppearState:isAnimating:] + 710
12 UIKit 0x000000010c317958 -[UIViewController __viewWillAppear:] + 149
13 UIKit 0x000000010ca25e4a -[UICollectionViewController __viewWillAppear:] + 52
14 UIKit 0x000000010c347750 -[UINavigationController _startCustomTransition:] + 1203
15 UIKit 0x000000010c357b9b -[UINavigationController _startDeferredTransitionIfNeeded:] + 712
16 UIKit 0x000000010c358d0b -[UINavigationController __viewWillLayoutSubviews] + 57
17 UIKit 0x000000010c507503 -[UILayoutContainerView layoutSubviews] + 248
18 UIKit 0x000000010c231980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
19 QuartzCore 0x000000010f8fbc00 -[CALayer layoutSublayers] + 146
20 QuartzCore 0x000000010f8f008e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
21 QuartzCore 0x000000010f8eff0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
22 QuartzCore 0x000000010f8e43c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
23 QuartzCore 0x000000010f912086 _ZN2CA11Transaction6commitEv + 486
24 UIKit 0x000000010c1a319b _afterCACommitHandler + 174
25 CoreFoundation 0x000000010b5a4c37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 23
26 CoreFoundation 0x000000010b5a4ba7 __CFRunLoopDoObservers + 391
27 CoreFoundation 0x000000010b59a7fb __CFRunLoopRun + 1147
28 CoreFoundation 0x000000010b59a0f8 CFRunLoopRunSpecific + 488
29 GraphicsServices 0x000000010fb11ad2 GSEventRunModal + 161
30 UIKit 0x000000010c176f09 UIApplicationMain + 171
31 CameraMagicNew 0x000000010a7e04bf main + 111
32 libdyld.dylib 0x00000001100a992d start + 1
33 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

How to force portrait when taking a photo?

I want only portrait when presenting the camera controller.

The problem is that when I present it initially in landscape, the view controller remains this way and when turning the device it's already flipped. However, there is no problem if the first time you present the camera in portrait mode.

I don't know if this is a bug or I'm not doing something correctly. But, I really need to present the camera controller in portrait.

Thank you in advance.

Photos upside down

When I'm taking a photo as a selfie in portrait orientation (i.e. UpMirrored orientation) the photo is saved to the library upside down. It seems to work correctly in any other cases though.

Thank you in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.