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
Stasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 PointsMaking Photo Bomb app with tabbed view controllers
I'm trying to integrate the Photo Bomb app into a tabbed view controller. (Tabs are Facebook, Instagram, and Twitter). I've tried making it from the start by making a new project with them already on it, and adding the classes from photo bomb onto it. This hasn't worked because the photobomb part takes up the entire screen without showing the tabs.
How do I integrate the Photo Bomb app into a tabbed view? Thanks
3 Answers
Stone Preston
42,016 Pointscan you post the code where you are adding the photo collection view?
Stone Preston
42,016 Pointsone thing you might try is adjusting the frame of your view in your view controller's viewDidLoad method to account for the tab bar.
self.view.frame = CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y, self.view.frame.size.width,self.view.frame.size.height - self.tabBarController.tabBar.frame.size.height);
Stasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 PointsThat didn't work. I added that line to viewDidLoad on PhotosViewController, but that didn't do anything. I even tried changing self.view and all the other ones in it to self.collectionView.
Stasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 PointsDo you want me to upload a zip of the project?
Stone Preston
42,016 Pointssure that will work. upload it to dropbox or something and ill take a look at it
Stasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 PointsStone Preston
42,016 Pointsin your did finish launching with options you are going to have to comment out some code. whats happening is you are creating a photo view controller and setting that as the root view, meaning your tab bar never gets a chance to appear. comment out the stuff in that method
{
SimpleAuth.configuration[@"instagram"] = @{
@"client_id" : @"87b879276a2042f89fd03fb48edada00",
SimpleAuthRedirectURIKey : @"photobombers://auth/instagram"
};
// self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
//
// PhotosViewController *photosViewController = [[PhotosViewController alloc] init];
// UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:photosViewController];
//
// UINavigationBar *navigationBar = navigationController.navigationBar;
// navigationBar.barTintColor = [UIColor colorWithRed:232.0 / 255.0 green:129.0 / 255.0 blue:91.0 / 255.0 alpha:1.0];
// navigationBar.barStyle = UIBarStyleBlackOpaque;
// navigationBar.tintColor = [UIColor whiteColor];
//
// self.window.rootViewController = navigationController;
//
// self.window.backgroundColor = [UIColor whiteColor];
// [self.window makeKeyAndVisible];
return YES;
}
pretty much everything but the simple auth config and the return statement. When you run your app, you will see your tab bar (YAY!). but when you switch to the photos, it crashes ( OHH NO!).
I hope you can figure out how to make it work. doesnt seem like ti will be easy though
Stasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 PointsThanks! I'll try that
Stasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 PointsStasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 PointsI didn't add it, I included it in the custom class in storyboard.
Stone Preston
42,016 PointsStone Preston
42,016 Pointsok can you post a screenshot of what your storyboard looks like
Stasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 PointsStasy Meclazcke
Full Stack JavaScript Techdegree Student 3,051 Pointshttp://imgur.com/lBvEXus