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
func modifiedCopy<Struct, Arg>(start: Struct, @noescape mutator: (inout Struct) -> Arg -> (), arg: Arg) -> Struct { | |
var new = start | |
mutator(&new)(arg) | |
return new | |
} | |
extension Array { | |
func arrayByAppending(e: Element) -> Array { | |
return modifiedCopy(self, mutator: Array.append, arg: e) |
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
// | |
// NSObject+RFExtensions.h | |
// | |
// Created by brandon on 10/5/12. | |
// Copyright (c) 2012 redf.net. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
typedef void (^NSObjectPerformBlock)(id userObject); |
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
// | |
// DTAsyncFileDeleter.m | |
// DTFoundation | |
// | |
// Created by Oliver Drobnik on 2/10/12. | |
// Copyright (c) 2012 Cocoanetics. All rights reserved. | |
// | |
#import "DTAsyncFileDeleter.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
#import "ImageManipulator.h" | |
@implementation ImageManipulator | |
static void addRoundedRectToPath(CGContextRef context, CGRect rect, float ovalWidth, float ovalHeight) | |
{ | |
float fw, fh; | |
if (ovalWidth == 0 || ovalHeight == 0) { | |
CGContextAddRect(context, rect); | |
return; |
NewerOlder