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 application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any]) -> Bool { | |
if let dynamiclink = DynamicLinks.dynamicLinks()?.dynamicLink(fromCustomSchemeURL: url) { | |
handleLink(link: dynamiclink) | |
return true | |
} | |
return false | |
} | |
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool { |
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
class PostImagesModel { | |
enum CellImage { | |
case Required, Add, Actual(image: UIImage), Remote(url: NSURL) | |
} | |
private let maxLimit = 6 | |
private var items: [CellImage] = [] | |
func add(image: UIImage) { |
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
- (instancetype)initWithElements:(id)firstObj, ... { | |
self = [self init]; | |
if (self) { | |
va_list(args); | |
va_start(args, firstObj); | |
[_objects addObject:firstObj]; | |
id obj; | |
while ((obj = va_arg(args, id)) != nil) { | |
[_objects addObject:obj]; | |
} |
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 * eng_items() { | |
return @[@"Laptop charging", | |
@"iPhone charging", | |
@"Cosmetics", | |
@"Watch", | |
@"Umbrella", | |
@"Toothbrush", | |
@"Deodorant", | |
@"Headphones", | |
@"Wipes", |
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
class WithSingleton { | |
class var sharedInstance :WithSingleton { | |
struct Singleton { | |
static let instance = WithSingleton() | |
} | |
return Singleton.instance | |
} | |
} |
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
AVPlayerItem * playerItem = [project playerItem]; | |
if ([playerItem.videoComposition.instructions count] < 1) { | |
if (completionHandler) completionHandler(nil); | |
return; | |
} | |
AVSynchronizedLayer *synchronizedLayer = [project synchronizedLayer]; | |
AVMutableVideoComposition *mvc = [AVMutableVideoComposition videoComposition]; | |
mvc.instructions = playerItem.videoComposition.instructions; | |
mvc.renderScale = playerItem.videoComposition.renderScale; | |
mvc.renderSize = playerItem.videoComposition.renderSize; |
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
find . "(" -name "*.m" -or -name "*.mm" -or -name "*.cpp" -or -name "*.h" ")" -print0 | xargs -0 wc -l |
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
#ifdef DEBUG | |
#define NSLog(...) NSLog(__VA_ARGS__) | |
#else | |
#define NSLog(...) | |
#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
//for loggin memory usage: | |
#import "mach/mach.h" | |
vm_size_t usedMemory(void) { | |
struct task_basic_info info; | |
mach_msg_type_number_t size = sizeof(info); | |
kern_return_t kerr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &size); | |
return (kerr == KERN_SUCCESS) ? info.resident_size : 0; // size in bytes | |
} |
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 *)cacheFilenameForURL:(NSURL *)resourceURL atSize:(CGSize)size atScaleFactor:(CGFloat)scaleFactor atPage:(int)page | |
{ | |
NSString *cacheFilename = nil; | |
#ifdef UIIMAGE_PDF_CACHEING | |
NSFileManager *fileManager = [ NSFileManager defaultManager ]; | |
NSString *filePath = [ resourceURL path ]; | |
NewerOlder