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 "TUIRefreshControl.h" | |
#import "TUIActivityIndicatorView.h" | |
#import "TUICGAdditions.h" | |
#import "NSColor+TUIExtensions.h" | |
static CGFloat const TUIRefreshTotalHeight = 350; | |
static CGFloat const TUIRefreshMinTopPadding = 9; | |
static CGFloat const TUIRefreshMaxTopPadding = 5; | |
static CGFloat const TUIRefreshMinTopRadius = 12.5; | |
static CGFloat const TUIRefreshMaxTopRadius = 16; |
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
@interface TUIScrollView : TUIView | |
{ | |
CGPoint _unroundedContentOffset; | |
CGSize _contentSize; | |
CGSize resizeKnobSize; | |
TUIEdgeInsets _contentInset; | |
__unsafe_unretained id _delegate; | |
TUIScrollKnob * _verticalScrollKnob; |
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
// | |
// CFIAlternatingTableView.m | |
// | |
// Created by Robert Widmann on 1/6/13. | |
// Copyright (c) 2015 CodaFi. All rights reserved. | |
// | |
#import "CFIAlternatingTableView.h" | |
#import "CFIAlternatingClipView.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
- (NSData*)dataBySnappyCompression { | |
size_t compressedLen = snappy_max_compressed_length(self.length); | |
NSMutableData *result = [NSMutableData dataWithLength:(snappy_max_compressed_length(compressedLen + 0x4))]; | |
snappy_status opCode = snappy_compress([self bytes], [self length], [result mutableBytes], &compressedLen); | |
if (opCode != SNAPPY_OK) { | |
LEPLog(@"Failed snappy compress: tried to compress %lu bytes", result.length); | |
NSAssert(nil, @"Failed Snappy compress"); | |
result = nil; | |
} else { | |
[result setLength:compressedLen + 4]; |
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
@interface NSIndexPath (CFIAdditions) | |
#ifdef TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED <= 60000 | |
+ (NSIndexPath *)indexPathForRow:(NSInteger)row inSection:(NSInteger)section; | |
+ (NSIndexPath *)indexPathForItem:(NSInteger)item inSection:(NSInteger)section; | |
#endif | |
@end | |
@implementation NSIndexPath (CFIAdditions) |
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
ACCELERATE(x) _mm_set1_ps((float)&x) | |
DECCELERATE_INTO(x, f) _mm_store_ss(&f, result) | |
Sample usage: | |
//accelerate a float into a super-fast 128 mm register | |
float x = 1.0f; | |
__m128 vecX = ACCELERATE(x); | |
//deccelerate a 128 mm register value back to a float |
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 DMArrayDivide(NSArray **slices, NSArray *inArray, NSUInteger parts) { | |
if (parts == 0 || parts == 1) { | |
*slices = inArray; | |
return; | |
} | |
NSMutableArray *arrays = [NSMutableArray arrayWithCapacity:parts]; | |
for (int i = 0; i < parts; i++) { | |
arrays[i] = @[].mutableCopy; | |
} | |
long int idx = 0; |
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
// | |
// NSArray+CFIWhere.h | |
// CFIArrayController | |
// | |
// Created by Robert Widmann on 4/9/13. | |
// Copyright (c) 2013 CodaFi. All rights reserved. | |
// | |
#import <Foundation/Foundation.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
static NSMachPort *existancePort = nil; | |
/** | |
* Used by the CFICheckForOtherRunningInstancesOfCurrentApplication() function to | |
* create a unique NSMachPort object. This string *CANNOT CHANGE* in the future, | |
* otherwise conflicting versions of an App will run on the same machine and | |
* defeat the purpose of this function. | |
*/ | |
static NSString *const CFIPortNameConstant = @"SomeNon-ArbitraryPortName"; |
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 DMIndexSetDivide(NSArray **slices, NSIndexSet *inIndexSet, NSUInteger parts) { | |
if (parts == 0 || parts == 1) { | |
*slices = [NSArray arrayWithObject:inIndexSet]; | |
return; | |
} | |
NSMutableArray *indexSets = [NSMutableArray arrayWithCapacity:parts]; | |
for (int i = 0; i < parts; i++) { | |
indexSets[i] = [NSMutableIndexSet indexSet]; | |
} | |
OlderNewer