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 - Keyboard Appearance | |
- (void)keyboardWillShow:(NSNotification *)notification | |
{ | |
NSDictionary* info = [notification userInfo]; | |
CGRect keyboardFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; | |
keyboardFrame = [self.view.window convertRect:keyboardFrame toView:self.view]; | |
CGRect intersectRect = CGRectIntersection(self.view.frame, keyboardFrame); | |
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
static NSString *dir = @"/Users/liam.nichols/Desktop/layers/"; | |
-(void)sublayersToFile | |
{ | |
for (UIWindow *window in [[UIApplication sharedApplication] windows]) | |
{ | |
if ([window isKindOfClass:NSClassFromString(@"UITextEffectsWindow")]) | |
{ | |
[self subviewsInView:window]; | |
break; |
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 - UIImage Representations | |
- (UIImage *)imageRepresentation | |
{ | |
CGFloat scale = [[UIScreen mainScreen] scale]; | |
CGRect rect = CGRectMake(0, 0, scale, scale); | |
CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB(); | |
CGContextRef context = CGBitmapContextCreate(NULL, CGRectGetWidth(rect), CGRectGetHeight(rect), 8, 0, rgbColorSpace, kCGImageAlphaPremultipliedFirst); |
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
// | |
// Created by Liam Nichols on 06/08/2013. | |
// Copyright (c) 2013 Liam Nichols. All rights reserved. | |
// | |
// To change the template use AppCode | Preferences | File Templates. | |
// | |
#import "LNCollectionViewPagedLayout.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
//Pull all the policy option hash's into memory | |
NSManagedObjectContext *managedObjectContext = [[SalesManager sharedSalesManager] managedObjectContext]; | |
NSExpressionDescription* objectIdDesc = [NSExpressionDescription new]; | |
objectIdDesc.name = @"objectID"; | |
objectIdDesc.expression = [NSExpression expressionForEvaluatedObject]; | |
objectIdDesc.expressionResultType = NSObjectIDAttributeType; | |
NSFetchRequest *search = [NSFetchRequest fetchRequestWithEntityName:[ExtraPrice entityName]]; | |
search.resultType = NSDictionaryResultType; | |
search.returnsDistinctResults = 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
// System Device Type (iPhone1,0) (Formatted = iPhone 1) | |
+ (NSString *)systemDeviceTypeFormatted:(BOOL)formatted { | |
// Set up a Device Type String | |
NSString *DeviceType; | |
// Check if it should be formatted | |
if (formatted) { | |
// Formatted | |
@try { | |
// Set up a new Device Type String |
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
// System Device Type (iPhone1,0) (Formatted = iPhone 1) | |
+ (NSString *)systemDeviceTypeFormatted:(BOOL)formatted { | |
// Set up a Device Type String | |
NSString *DeviceType; | |
// Check if it should be formatted | |
if (formatted) { | |
// Formatted | |
@try { | |
// Set up a new Device Type String |
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
/* | |
File: UIImage+ImageEffects.h | |
Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur. | |
Version: 1.0 | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple | |
Inc. ("Apple") in consideration of your agreement to the following | |
terms, and your use, installation, modification or redistribution of | |
this Apple software constitutes acceptance of these terms. If you do | |
not agree with these terms, please do not use, install, modify or |
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)applicationDidEnterBackground:(UIApplication *)application | |
{ | |
self.window.layer.rasterizationScale = 0.1f; | |
self.window.layer.shouldRasterize = YES; | |
} | |
- (void)applicationWillEnterForeground:(UIApplication *)application | |
{ | |
self.window.layer.rasterizationScale = 1.0f; | |
self.window.layer.shouldRasterize = 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
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
self.manager = [[CBCentralManager alloc] initWithDelegate:self queue:nil options:nil]; | |
} | |
-(void)centralManagerDidUpdateState:(CBCentralManager *)central | |
{ | |
if (self.manager.state == CBCentralManagerStatePoweredOn) | |
{ | |
[self.manager scanForPeripheralsWithServices:nil options:nil]; |
OlderNewer