Skip to content

Instantly share code, notes, and snippets.

View mjjimenez's full-sized avatar

Mark Jimenez mjjimenez

View GitHub Profile
@mjjimenez
mjjimenez / adjust_view_frame
Created October 18, 2013 06:28
Adjust offset of view when keyboard hides a textfield
- (void)viewWillAppear:(BOOL)animated
{
// register for keyboard notifications
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
@mjjimenez
mjjimenez / add_activity_indicator
Created October 18, 2013 06:07
Add an activity indicator as a subview
//Create and add the Activity Indicator to splashView
UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
activityIndicator.alpha = 1.0;
activityIndicator.center = CGPointMake(160, 360);
activityIndicator.hidesWhenStopped = NO;
[splashView addSubview:activityIndicator];
[activityIndicator startAnimating];
@mjjimenez
mjjimenez / .gitattributes
Created October 18, 2013 03:35
Set pbxproj as binary and merge rule as union
*.pbxproj binary merge=union
@mjjimenez
mjjimenez / StoryboardController
Created October 17, 2013 07:29
Get the first view controller of a storyboard
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"HelpStoryboard" bundle:nil];
UIViewController* initialHelpView = [storyboard instantiateInitialViewController];
@mjjimenez
mjjimenez / 0_reuse_code.js
Created October 3, 2013 11:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console