ca-archived / iOS-NBUImagePicker

Modular image picker with Simulator-compatible AVFondation camera, assets library, filters and more.
http://cyberagent.github.io/iOS-NBUImagePicker
Apache License 2.0
193 stars 48 forks source link

Customize NBUAssetsLibraryViewController in a non-storyboard project #5

Closed toyhunter closed 10 years ago

toyhunter commented 10 years ago

First of all, thank you for making image picker so modular. Currently I am trying to customize NBUAssetsLibraryViewController by subclassing it in a non-storyboard project.

My first attempt is to manually connect IBOutlet of objectTableView to a UIView which I put into a xib file (of NBUAssetsLibraryViewController's subclass). The table view of albums was shown as expected, but after I tap on each album nothing happens. I guess I have to connect IBAction somehow but have no idea where to perform it.

Is there an easy or the right way to customize NBUAssetsLibraryViewController for non-storyboard projects?

I am sorry to bother you with this non-bug issue, but I would appreciate if you can give any suggestion or relevant pointer to achieve this task.

Thank you.

rivera-ernesto commented 10 years ago

Thank you for opening the issue. I try to make the controllers as configurable as possible so cases like yours help a lot.

Well what you need is to trigger assetsGroupViewTapped:. The easiest way to do it is by simply displaying NBUAssetsGroupView's in your objectTableView. Those views are already configured to trigger the method above in the NBUAssetsLibraryViewController.

Then you can customize what actually happens when you tap an album by setting a groupSelectedBlock.

toyhunter commented 10 years ago

@rivera-ernesto Many thanks for a hint! I will figure it out based on your guideline. Again, great component!