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
// | |
// main.m | |
// UpdateXcodePluginUUIDs | |
// | |
// Created by Tanner on 12/21/15. | |
// Copyright © 2015 Tanner Bennett. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
//call this after download or after saving a file | |
//Example: [self addSkipBackupAttributeToItemAtURL:[NSURL fileUrlWithPath:@"your path here"]]; | |
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL | |
{ | |
assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]); | |
NSError *error = nil; | |
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES] | |
forKey: NSURLIsExcludedFromBackupKey error: &error]; |
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
#import <UIKit/UIKit.h> | |
@interface RCDropdown : UITextField | |
@property (nonatomic) id<UIPickerViewDelegate> pickerDelegate; | |
@property (nonatomic) id<UIPickerViewDataSource> pickerDataSource; | |
@end |
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]; |
NewerOlder