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
git checkout develop | |
git pull origin develop | |
git checkout stage | |
git reset --hard develop | |
git push origin stage --force-with-lease |
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
// iOS Push Payload | |
{ | |
"aps":{ | |
"alert":{ | |
"body":"some kind of message body ..", | |
"title":"some kind of title .." | |
}, | |
badge: 1, | |
sound = default | |
}, |
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
/** | |
* Determines the properties of @c className and returns list of these properties as strings. | |
* The method will iterate through @c className superclass hierarchy and fetch the properties from | |
* the superclass hierarchy as well. | |
* | |
* @return the list of properties found on @c className | |
*/ | |
- (NSOrderedSet<NSString *> *)getMethodListForClass:(Class)className | |
{ | |
NSMutableOrderedSet<NSString *> *propertiesList = [NSMutableOrderedSet orderedSet]; |
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 <objc/runtime.h> | |
- (NSArray *)discoverAppModuleClasses | |
{ | |
NSMutableArray *appModuleClasses = [NSMutableArray array]; | |
// Integrate all classes which comply to the provider protocol | |
unsigned int count = 0; | |
Class *classList = objc_copyClassList(&count); | |
for (NSUInteger index = 0; index < count; index++) |
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
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2013 Peter Steinberger. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
// Compile-time selector checks. |
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
__weak __typeof__(self) weakSelf = self; | |
// some api that takes blocks, when you give the block do | |
^{ | |
__strong __typeof__(weakSelf) self = weakSelf; | |
} |
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
CADisplayLink *displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(refresh:)]; | |
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; | |
counter = 0; | |
previousTimestamp = displayLink.timestamp; | |
- (void)refresh:(CADisplayLink *)displayLink { | |
counter++; | |
if (counter > 60) { |
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)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { | |
// setup initial state (e.g. before animation) | |
cell.layer.shadowColor = [[UIColor blackColor] CGColor]; | |
cell.layer.shadowOffset = CGSizeMake(10, 10); | |
cell.alpha = 0; | |
cell.layer.transform = CATransform3DMakeScale(0.5, 0.5, 0.5); | |
cell.layer.anchorPoint = CGPointMake(0, 0.5); | |
// define final state (e.g. after animation) & commit animation | |
[UIView beginAnimations:@"scaleTableViewCellAnimationID" context:NULL]; |
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
+ (NSNumberFormatter *)numberFormatter { | |
static NSNumberFormatter *_numberFormatter = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_numberFormatter = [[NSNumberFormatter alloc] init]; | |
[_numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; | |
}); | |
return _numberFormatter; | |
} |
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
NS_INLINE void MVComputeTimeWithNameAndBlock(const char *caller, void (^block)()) { | |
CFTimeInterval startTimeInterval = CACurrentMediaTime(); | |
block(); | |
CFTimeInterval nowTimeInterval = CACurrentMediaTime(); | |
NSLog(@"%s - Time Running is: %f", caller, nowTimeInterval - startTimeInterval); | |
} | |
#define MVComputeTime(...) MVComputeTimeWithNameAndBlock(__PRETTY_FUNCTION__, (__VA_ARGS__)) |