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) generate1BitGIF | |
{ | |
UIImage* image = [ UIImage imageNamed: @"TestImage.png" ]; | |
NSFileManager* fm = [ NSFileManager defaultManager ]; | |
NSURL* destDir = [ fm URLForDirectory: NSDocumentDirectory | |
inDomain: NSUserDomainMask | |
appropriateForURL: nil | |
create: YES | |
error: nil ]; |
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
#ifndef NDEBUG | |
#define InfDebugLog( ... ) NSLog( __VA_ARGS__ ) | |
#else | |
#define InfDebugLog( ... ) | |
#endif |
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
NSFetchRequest* fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Widget"]; | |
fetchRequest.predicate = [NSPredicate predicateWithFormat:@"type == %@", someType]; | |
fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"createddate" ascending:YES]]; | |
fetchRequest.fetchLimit = 5; | |
NSError* error; | |
NSArray* widgets = [self.managedObjectContext executeFetchRequest:fetchRequest 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
/** | |
Provides the ability to verify key paths at compile time. | |
If "keyPath" does not exist, a compile-time error will be generated. | |
Example: | |
// Verifies "isFinished" exists on "operation". | |
NSString *key = SQKeyPath(operation, isFinished); | |
// Verifies "isFinished" exists on self. |
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
// Source for the Accidental Tech Podcast (ATP) T-Shirt: | |
// http://www.marco.org/2014/04/29/atp-shirts | |
// | |
// By Troy Gaul, June 2, 2014. | |
// | |
// Based on Obj-C veresion by Marco Arment, April 28, 2014. MIT license. | |
// https://gist.github.com/marcoarment/2542cd28cb5df0aa97d8 | |
import UIKit |
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
From 94e6ad1869622652b9752e410f3dc24a02bca0f0 Mon Sep 17 00:00:00 2001 | |
From: Troy Gaul <[email protected]> | |
Date: Wed, 26 Oct 2016 16:37:43 -0500 | |
Subject: [PATCH] Changes to get compiling with Xcode 8.1. | |
--- | |
Photo Editor/CanvasViewController.swift | 2 +- | |
Photo Editor/PhotoController.swift | 2 +- | |
Photo Editor/PhotoDocumentWindowController.swift | 4 ++-- | |
Photo Editor/SidebarViewController.swift | 8 ++++---- |