This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//To fetch a branch, you simply need to: | |
git fetch origin | |
//This will fetch all of the remote branches for you. With the remote branches | |
//in hand, you now need to check out the branch you are interested in, giving | |
//you a local working copy: | |
git checkout -b test origin/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clean -f | |
If you want to also remove directories, run git clean -f -d. | |
If you just want to remove ignored files, run git clean -f -X. | |
If you want to remove ignored as well as non-ignored files, run git clean -f -x. | |
Note the case difference on the X for the two latter commands. | |
If clean.requireForce is set to "true" (the default) in your configuration, then unless you specify -f nothing will actually happen, with a recent enough version of git. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - UITextField Delegates | |
-(void)textFieldDidBeginEditing:(UITextField *)textField | |
{ | |
self.activeTextField = textField; | |
} | |
#pragma mark - Keyboard Notification Methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[webView setBackgroundColor:[UIColor clearColor]]; | |
[webView setOpaque:NO]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@property (nonatomic, weak) KGModalContainerView *containerView; | |
... | |
-(void)viewDidLoad { | |
[super viewDidLoad]; | |
KGModalContainerView *myContainerView = [[KGModalContainerView alloc] initWithFrame:containerViewRect]; // This is a strong reference to that view | |
[self.view addSubview:myContainerView]; //Here self.view retains myContainerView | |
self.containerView = myContainerView; // Now self.containerView has weak reference to that view, but if your self.view removes this view, self.containerView will automatically go to nil. | |
// In the end ARC will release myContainerView, but it's retained by self.view and weak referenced by self.containerView | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Start an activity indicator here | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
//Call your function or whatever work that needs to be done | |
//Code in this part is run on a background thread | |
dispatch_async(dispatch_get_main_queue(), ^(void) { | |
//Stop your activity indicator or anything else with the GUI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Custom tab bar implementation from http://www.wiredbob.com/2009/04/iphone-tweetie-style//-navigation.html | |
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item | |
{ | |
if (item == favouritesTabBarItem) { | |
UIViewController *fabViewController = [viewControllers objectAtIndex:0]; | |
[self.selectedViewController.view removeFromSuperview]; | |
[self.view addSubview:fabViewController.view]; | |
self.selectedViewController = fabViewController; | |
} else if (item == moreTabBarItem) { | |
UIViewController *moreViewController = [viewControllers objectAtIndex:1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create the UIViewController | |
MyViewController * viewController = [[MyViewController alloc] init]; | |
// Hide the tab bar | |
viewController.hidesBottomBarWhenPushed = YES; | |
// Push onto the view stack | |
[[self navigationController] pushViewController:viewController animated:YES]; |
NewerOlder