Skip to content

Instantly share code, notes, and snippets.

View tonyalbor's full-sized avatar

Tony Albor tonyalbor

  • Santa Monica, CA
View GitHub Profile
@tonyalbor
tonyalbor / github xcode project
Created April 6, 2014 02:13
uploading an xcode project to github
// adding xcode project to github
// create git repo on github
// go to directory with .xcodeproj file
git init
git add .
git commit -m 'initial commit'
git remote add origin git@github.com:tonyalbor/REPOSITORY.git
git pull origin master
git push origin master
@tonyalbor
tonyalbor / textfieldReturn
Created January 15, 2014 01:50
hitting return on the keyboard will go to the next textfield
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
NSInteger nextTag = textField.tag + 1;
UIResponder *nextResponder = [[textField superview] viewWithTag:nextTag];
if(nextResponder) [nextResponder becomeFirstResponder];
else [textField resignFirstResponder];
return NO;
}
@tonyalbor
tonyalbor / singleton
Created January 15, 2014 01:48
implement singleton class
static DataSource *_sharedDataSource = nil;
+ (DataSource *)sharedDataSource {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_sharedDataSource = [[DataSource alloc] init];
// further initialization
});
return _sharedDataSource;