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
[KWMatchers defineMatcher:@"beUppercaseString" as:^(KWMatcherBuilder *builder) { | |
[builder match:^(id subject) { | |
if ([subject isKindOfClass:[NSString class]]) { | |
NSString *string = (NSString *)subject; | |
return [[string uppercaseString] isEqualToString:string]; | |
} else { | |
return 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
// | |
// UIColor+Hex.h | |
// SRKit | |
// | |
// Created by Sadat Rahman on 29/11/08. | |
// Copyright Sadat Rahman 2008. All rights reserved. | |
// | |
@interface UIColor (Hex) |
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
// | |
// UIView+CMExtras.h | |
// | |
// Created by Chris Miles on 9/06/11. | |
// Copyright 2011 Chris Miles. | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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 NSDate ( CMExtras ) | |
- (NSDate *)stripTimeComponent; | |
@end |
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
[CATransaction begin]; | |
CATransition *transition = [CATransition animation]; | |
transition.type = kCATransitionFade; | |
transition.duration = animated ? 0.5f : 0.0f; | |
transition.fillMode = kCAFillModeForwards; | |
transition.removedOnCompletion = YES; | |
[[UIApplication sharedApplication].keyWindow.layer addAnimation:transition forKey:@"transition"]; | |
[[UIApplication sharedApplication] beginIgnoringInteractionEvents]; |
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
/*! | |
\def N_ARGS | |
\brief Macro that can tell how many variable arguments have been passed to it (up to a total of 16). | |
*/ | |
#define N_ARGS(...) N_ARGS_1(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) | |
#define N_ARGS_1(...) N_ARGS_2(__VA_ARGS__) | |
#define N_ARGS_2(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, n, ...) n | |
/*! | |
\def CAT |
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)simulateMemoryWarning { | |
#if TARGET_IPHONE_SIMULATOR | |
#ifdef DEBUG | |
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), (CFStringRef)@"UISimulatedMemoryWarningNotification", NULL, NULL, true); | |
#endif | |
#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
// | |
// MyLayer.m | |
// | |
// Created by Chris Miles on 14/03/11. | |
// Copyright 2011 Chris Miles. | |
// | |
/* | |
Animate custom property example: |
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
#!/bin/bash | |
f=$(pwd) | |
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork" | |
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x" | |
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png" | |
sips --resampleWidth 114 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png" | |
sips --resampleWidth 58 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png" |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>items</key> | |
<array> | |
<dict> | |
<key>assets</key> | |
<array> | |
<dict> |