ca-archived/iOS-NBUImagePicker

Customize NBUAssetsLibraryViewController in a non-storyboard project

toyhunter opened this issue · 2 comments

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.

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.

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