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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// Override point for customization after application launch. | |
UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController; | |
MasterViewController *controller = (MasterViewController *)navigationController.topViewController; | |
controller.managedObjectContext = self.managedObjectContext; | |
return YES; | |
} |
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
- (void)setupBackButtonWithSelector:(SEL)selector { | |
// create a custom button | |
LIButton *backButton = [LIButton buttonWithType:UIButtonTypeCustom]; | |
backButton.positionInNavBar = LIButtonNavPositionLeft; | |
// more back button setup | |
// add back button to navigation bar | |
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton]; | |
self.navigationItem.leftBarButtonItem = backItem; | |
} |
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
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
// lots of stuff | |
// http://stackoverflow.com/questions/19101361/ios7-change-uinavigationbar-border-color/19102809#19102809 | |
[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] | |
forBarMetrics:UIBarMetricsDefault]; | |
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
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender | |
{ | |
UIViewController *nextController = [segue destinationViewController]; | |
if ([nextController isKindOfClass:[NewRunViewController class]]) { | |
// aha! | |
((NewRunViewController *)nextController).managedObjectContext = self.managedObjectContext; | |
} | |
} |
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
- (IBAction)mergeImages:(id)sender { | |
UIImage *myFirstImage = [UIImage imageNamed:@"lemonface.png"]; | |
UIImage *myTopImage = [UIImage imageNamed:@"crateKitty-holdingWater.png"]; | |
CGFloat yFloat =10; | |
CGFloat xFloat = 10; | |
UIImage *newImage = [self placeImageOnImage:myFirstImage topImage:myTopImage x:xFloat y:yFloat]; | |
[[self theNewImageView] setImage:newImage]; | |
} | |
-(UIImage *)placeImageOnImage:(UIImage *)image topImage:(UIImage *)topImage |
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
// is this standard???? | |
var MySnowboard = (function () { | |
// private static | |
var serialNumber = 1; | |
// constructor without any vowels. why? just because. it's hip | |
var snwbrd = function () { | |
// private | |
var id = serialNumber++; | |
var name = 'Deep Moist Unknown'; |
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
/* | |
http://www.javascriptkit.com/javatutors/closures.shtml | |
closure is the local variables for a function - kept alive AFTER the function hs returned | |
closure is a stack-frame which is not deallocaed when the function returns | |
wait... what? javascript has malloc? i thought it was fluffy. they care about memory management? | |
just kidding | |
*/ | |
function sayOriginators(originalPlaya) { | |
var shoutOutScrawl = 'people dont know where it started where it came from but ' + |
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
// how many snowboards is too many snowboards? | |
function SnowboardHoarder() {} | |
SnowboardHoarder.constructor = SnowboardHoarder //???? | |
SnowboardHoarder.prototype.snowboardQuantity = function(currentNumberOwned) { | |
var finalNumber = 1; | |
if (currentNumberOwned == 0) { | |
finalNumber = 3; | |
} else { | |
finalNumber = currentNumberOwned + 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
// http://www.phpied.com/3-ways-to-define-a-javascript-class/ | |
// so javascript doesn't really have classes but dictionaries | |
// but you can fake classes? | |
// methods added to the prototype | |
function Ruffneck () { | |
this.gender = "man"; | |
this.shoes = "Timberlands"; | |
this.hair = "shaved"; | |
} |
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 "Skateboard.js" | |
function Snowboard() {} | |
// this is how it inherits from another instance | |
Snowboard.prototype = new Skateboard(); | |
Snowboard.constructor = Snowboard | |
// pushing a dictionary in javascript??? | |
Snowboard.prototype.tricks = function () { | |
// could this be done without a function??? |
OlderNewer