Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Install DB camera

I want to integrate this custom camera, called DB camera. https://github.com/danielebogo/DBCamera/blob/master/README.md But im not really sure on how to do it. I need some better instructions than the ones they provide.

2 Answers

Yes I did. I get FBTokenInformation errors. And by the way I am trying to implement this custom camera view into the self destructing messaging app

you are getting facebook token errors? im not really sure why this would affect that...hmm strange. remove any code related to the camera you added and see if the errors persist. if they do, something else is wrong with your project

To solve the FBTokenInformation errors add the frameworks :

it seems pretty simple. install cocoa pods (Treehouse has a short course on using cocoa pods here. then add pod 'DBCamera', '~> 1.1.2' to your podfile and run the pod command to install this one.

then import it into your viewController class:

#import "DBCameraViewController.h"
#import "DBCameraContainer.h"

and conform to the protocol in your viewController's .h file

@interface RootViewController () <DBCameraViewControllerDelegate>

then implement the following method (there are several ways to present it, this one seems the simplest)

- (void) openCamera
{
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[[DBCameraContainer alloc] initWithDelegate:self]];
    [nav setNavigationBarHidden:YES];
    [self presentViewController:nav animated:YES completion:nil];
}

and call that method when you want to present the camera. I havent tested this mind you so im not certain this is the way to do it, but I think it will work

When I try to run it, I get a lot of Apple Mach-O linker errors

are you using the workspace that was generated after you ran the pod command? you need to use that workspace in order for the pod to work