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
if [ "${CONFIGURATION}" = "Debug" ]; then | |
TAGS="\/\/ TODO:|\/\/TODO:|\/\/ FIXME:|\/\/FIXME:|\/\/ WARNING:|\/\/WARNING:" | |
echo "searching ${SRCROOT} for ${TAGS}" | |
find "${SRCROOT}" \( -name "*.swift" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($TAGS).*\$" | perl -p -e "s/${TAGS}/ warning: \$1/" | |
fi |
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 Foundation | |
extension UIColor { | |
convenience init(hex: Int, alpha: CGFloat? = nil) { | |
self.init(((hex >> 16) & 0xFF), | |
((hex >> 8) & 0xFF), | |
(hex & 0xFF), | |
alpha) | |
} |
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 Foundation | |
enum Roboto: String, FontFamily { | |
case thin = "Roboto-Thin" | |
case bold = "Roboto-Bold" | |
case light = "Roboto-Light" | |
case medium = "Roboto-Medium" | |
case regular = "Roboto-Regular" | |
} |
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 Foundation | |
typealias Localized = String | |
extension Localized { | |
func localize() -> String { | |
return NSLocalizedString(self, comment: "") | |
} | |
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 UIKit | |
extension CAGradientLayer { | |
enum Direction { | |
case left | |
case top | |
case right | |
case bottom | |
case custom(start: CGPoint, end: CGPoint) |
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 <Foundation/Foundation.h> | |
@interface NSString (Hash) | |
- (NSString *)md5; | |
+ (NSString *)stringWithHash:(unsigned char *)hash | |
digestLength:(int32_t)digestLength; | |
@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
#import <CoreData/CoreData.h> | |
@interface NSManagedObject (Additions) | |
#pragma mark - Life cycle management | |
+ (id)createInContext:(NSManagedObjectContext *)context; | |
- (void)deleteInContext:(NSManagedObjectContext *)context; | |
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 <Foundation/Foundation.h> | |
@interface NSData (Hash) | |
- (NSData *)SHA256; | |
- (NSString *)stringSHA256; | |
@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
#import <CoreData/CoreData.h> | |
@interface NSManagedObjectContext (AsyncExecute) | |
- (void)asyncExecuteFetchRequest:(NSFetchRequest *)request | |
completion:(void (^)(NSArray *objects, NSError *error))completion; | |
- (void)asyncCountForFetchRequest:(NSFetchRequest *)request | |
completion:(void (^)(NSInteger count, NSError *error))completion; |
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
#define IS_IPHONE UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone | |
#define IS_IPAD UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad | |
#define SYSTEM_VERSION_COMPARE(v) [[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] | |
#define IS_OS_EQUAL(v) (SYSTEM_VERSION_COMPARE(v) == NSOrderedSame) | |
#define IS_OS_GREATER(v) (SYSTEM_VERSION_COMPARE(v) == NSOrderedDescending) | |
#define IS_OS_GREATER_OR_EQUAL(v) (SYSTEM_VERSION_COMPARE(v) != NSOrderedAscending) | |
#define IS_OS_LESS(v) (SYSTEM_VERSION_COMPARE(v) == NSOrderedAscending) | |
#define IS_OS_LESS_OR_EQUAL(v) (SYSTEM_VERSION_COMPARE(v) != NSOrderedDescending) |
OlderNewer