This file contains hidden or 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
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentsDirectory = [paths objectAtIndex:0]; | |
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"file.plist"]; |
This file contains hidden or 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
build/ | |
*.mode1 | |
*.mode1v3 | |
*.mode2v3 | |
*.perspective | |
*.perspectivev3 | |
*.pbxuser | |
*.xcworkspace | |
xcuserdata |
This file contains hidden or 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
- (NSDate*)dateWithTimeComponentRemoved:(NSDate *)date { | |
NSCalendar *calendar = [NSCalendar currentCalendar]; | |
NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate:self]; | |
return [calendar dateFromComponents:components]; | |
} |
This file contains hidden or 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
// Turn on Location Services? | |
[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]]; | |
// Set up Twitter? | |
[NSURL URLWithString:@"prefs:root=TWITTER"]]; | |
// Hook up a Bluetooth device? | |
[NSURL URLWithString:@"prefs:root=General&path=Bluetooth"]]; | |
// Change app settings |
This file contains hidden or 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
// | |
// NSURL+QueryAttributes.m | |
// | |
// Created by Adam Swinden on 29/06/2012. | |
// Copyright (c) 2012 The OTHER Media. All rights reserved. | |
// | |
#import "NSURL+QueryAttributes.h" | |
@implementation NSURL (QueryAttributes) |
This file contains hidden or 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
// | |
// UIScreen+AspectRatio.h | |
// | |
// Created by Adam Swinden on 14/09/2012. | |
// Copyright (c) 2012 The OTHER Media. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
This file contains hidden or 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
// Quadratic | |
GLfloat QuadraticEaseOut(float t, float start, float end) { | |
if (t < 0.0f) t = 0.0f; | |
if (t > 1.0f) t = 1.0f; | |
return -end * t*(t-2) + start; | |
} | |
This file contains hidden or 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
// | |
// NSString+HTMLEntities.h | |
// | |
// Created by Adam Swinden on 10/10/2014. | |
// Copyright (c) 2014 Adam Swinden. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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
let viewController = SFSafariViewController(URL: url) | |
presentViewController(viewController, animated: true) { | |
for view in viewController.view.subviews { | |
if let recognisers = view.gestureRecognizers { | |
for gestureRecogniser in recognisers where gestureRecogniser is UIScreenEdgePanGestureRecognizer { | |
gestureRecogniser.enabled = false |
OlderNewer