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
- (void) showConfirmationAlert | |
{ | |
// A quick and dirty popup, displayed only once | |
if (![[NSUserDefaults standardUserDefaults] objectForKey:@"HasSeenPopup"]) | |
{ | |
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Question" | |
message:@"Do you like cats?" | |
delegate:self | |
cancelButtonTitle:@"No" | |
otherButtonTitles:@"Yes",nil]; |
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
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^ | |
{ | |
// Do heavy lifting | |
// Back to the main thread with the result | |
dispatch_sync(dispatch_get_main_queue(), ^ | |
{ | |
// Update UI etc | |
} | |
} |
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
@interface UIView (UIView_Snapshots) | |
// Take image snapshots of the current state of a view. | |
// Use the background color of the superview if you have rounded corners | |
// If background color is nil the background will be treated as transparent | |
- (UIImage*) imageOfViewUsingBackgroundColor:(UIColor*)backgroundColorOrNil; | |
// Will save to the documents directory as XXXX.png | |
- (void) saveImageOfViewToPNGNamed:(NSString*)fileNameMinusExtension usingBackgroundColor:(UIColor*)backgroundColorOrNil; |
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
// | |
// UIImage+ImageSplitting.h | |
// Test | |
// | |
// Created by Robert Saunders on 03/02/2012. | |
// Copyright (c) 2012 __MyCompanyName__. 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
// | |
// UIView+ViewExpanding.h | |
// VodafoneTest | |
// | |
// Created by Robert Saunders on 02/03/2012. | |
// Copyright (c) 2012 __MyCompanyName__. 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
-- Erica Sadun, http://ericasadun.com | |
-- iPhone Developer's Cookbook, 3.0 Edition | |
-- BSD License, Use at your own risk | |
-- Adapted by Rob Saunders to also replace embeded profiles | |
-- | |
-- | |
-- save in Script Editor as Application | |
-- drag files to its icon in Finder | |
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
// | |
// KDPersistantCache.h | |
// KDPrototype | |
// Stores NSCoding compliant objects persistantly in the NSCachesDirectory | |
// for a specified period of time. | |
// | |
// Created by on 18/04/2012. | |
// Copyright (c) 2012 __MyCompanyName__. All rights reserved. | |
// |
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
// | |
// UIView+ViewArranging.h | |
// Created by on 15/05/2012. | |
// | |
#import <UIKit/UIKit.h> | |
typedef enum { | |
ViewArrangingDirectionHorizontal, | |
ViewArrangingDirectionVertical |
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
// | |
// UIImage+Transform.h | |
// TestImage | |
// | |
// Created by Robert Saunders on 04/10/2012. | |
// Copyright (c) 2012 Robert Saunders. 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
[MyClass writeStringWithFileName:@"Complete" | |
option:NSDataWritingFileProtectionComplete]; | |
[MyClass writeStringWithFileName:@"CompleteUnlessOpen" | |
option:NSDataWritingFileProtectionCompleteUnlessOpen]; | |
[MyClass writeStringWithFileName:@"CompleteUntilFirstUserAuthentication" | |
option:NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication]; | |
[MyClass writeStringWithFileName:@"None" |