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
Gluestick Studios
Courses Plus Student 405 PointsRibbit "More Notifications, Please" Extra Credit Question
I need step-by-step instructions for how to program this, if that's possible.
1 Answer
Benjamin Bell
4,364 PointsHere is a very basic implementation - maybe you could find a better one on the cocoapods repository (it will send you to a github project anyways)
Get the MBProgressHUB .h/.m files from github, add them to your project.
In the cameraViewController import the MBProgressHub.h file then in your send IBAction method put the following lines into your if else statement:
if (!HUD) {
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
}
[self.navigationController.view addSubview:HUD];
HUD.labelText = @"Sending..";
HUD.removeFromSuperViewOnHide = YES;
[self uploadMessage];
[[[self tabBarController] tabBar] setUserInteractionEnabled:NO];
[HUD show:YES];
You will need to dismiss that view upon completion, once the PFObject is saved - therefore in the uploadMessage method, inside the completion block of the saveInBackground method add the following at the end before switching to the inbox tab:
[HUD hide:YES];
[[[self tabBarController] tabBar] setUserInteractionEnabled:YES];
oh yeah I defined HUD up in the @interface as a private instance variable:
@interface CameraViewController () {
MBProgressHUD *HUD;
}
Hope this helps,
don't forget to uprate :)
happy coding!
Gluestick Studios
Courses Plus Student 405 PointsGluestick Studios
Courses Plus Student 405 PointsIn the first code implement, which CameraViewController should I paste the code
Benjamin Bell
4,364 PointsBenjamin Bell
4,364 PointsIn your custom class for the camera tab, that should be where your send button method is implemented
Gluestick Studios
Courses Plus Student 405 PointsGluestick Studios
Courses Plus Student 405 PointsHi again, I'm having some trouble with your instructions. It would be a lot easier for me if you could post a video and give me the link. Thanks! Bye.