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
// | |
// UIViewController+ReplaceRoot.h | |
// | |
// Created by Victor Surikov on 08/03/16. | |
// Copyright © 2016 Victor Surikov. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIViewController (ReplaceRoot) |
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
// | |
// GPUImageMirrorFilter.h | |
// | |
#import <GPUImage/GPUImageFilter.h> | |
@interface GPUImageMirrorFilter : GPUImageFilter { | |
GLint verticalMirrorUniform, horizontalMirrorUniform; | |
} |
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 NSLocale (Utilities) | |
@property (nonatomic, readonly) NSDictionary *ISOLanguages; | |
+ (NSString *)getCountryNameForCode:(NSString *)countryCode; | |
+ (NSString *)getLanguageNameForCode:(NSString *)languageCode; | |
+ (NSString *)getLocalizedLanguageNameForCode:(NSString *)languageCode |
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)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken | |
{ | |
NSString * token = [[[[deviceToken description] | |
stringByReplacingOccurrencesOfString: @"<" withString: @""] | |
stringByReplacingOccurrencesOfString: @">" withString: @""] | |
stringByReplacingOccurrencesOfString: @" " withString: @""]; | |
// ... | |
} |
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 NSURL (Dictionaries) | |
@property (nonatomic, readonly) NSDictionary *queryDictionary; | |
@property (nonatomic, readonly) NSDictionary *fragmentDictionary; | |
- (NSURL *)URLByAppendingQueryParameters:(NSDictionary *)parameters; | |
@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
@interface MySingleton : NSObject | |
// ... | |
+ (instancetype) sharedInstance; | |
+ (instancetype) alloc __attribute__((unavailable("alloc not available, call sharedInstance instead"))); | |
- (instancetype) init __attribute__((unavailable("init not available, call sharedInstance instead"))); | |
+ (instancetype) new __attribute__((unavailable("new not available, call sharedInstance instead"))); |
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
+ (NSString*)getUUID | |
{ | |
CFUUIDRef newUniqueId = CFUUIDCreate(kCFAllocatorDefault); | |
NSString * uuidString = (__bridge_transfer NSString*)CFUUIDCreateString(kCFAllocatorDefault, newUniqueId); | |
CFRelease(newUniqueId); | |
return uuidString; | |
} |