This file contains hidden or 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
| /* | |
| Before: | |
| CGRect frame = myView.frame; | |
| frame.origin.x = newX; | |
| myView.frame = frame; | |
| After: | |
| myView.x = newX; | |
This file contains hidden or 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
| static __inline__ CGRect CGRectFromCGSize( CGSize size ) { | |
| return CGRectMake( 0, 0, size.width, size.height ); | |
| }; | |
| static __inline__ CGRect CGRectMakeWithCenterAndSize( CGPoint center, CGSize size ) { | |
| return CGRectMake( center.x - size.width * 0.5, center.y - size.height * 0.5, size.width, size.height ); | |
| }; | |
| static __inline__ CGRect CGRectMakeWithOriginAndSize( CGPoint origin, CGSize size ) { | |
| return CGRectMake( origin.x, origin.y, size.width, size.height ); |
This file contains hidden or 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+FirstObject.h | |
| // | |
| #import <Foundation/Foundation.h> | |
| @interface NSArray (FirstObject) | |
| - (id)firstObject; |
This file contains hidden or 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 (Extensions) | |
| + (NSString *)stringToSha1:(NSString *)str; | |
| - (NSNumber*)stringToNSNumber; | |
| - (BOOL)isEmpty; | |
| - (BOOL)stringContainsSubString:(NSString *)subString; | |
| - (NSString *)stringByReplacingStringsFromDictionary:(NSDictionary *)dict; |
This file contains hidden or 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 UILabel (dynamicSizeMe) | |
| -(float)resizeToFit; | |
| -(float)expectedHeight; | |
| @end |
This file contains hidden or 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/UIKit.h> | |
| @interface UIView (Stacker) | |
| - (void)stackSubviews; | |
| @end |
This file contains hidden or 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/UIKit.h> | |
| @interface UIView (RoundedCorners) | |
| - (void)setRoundedCorners:(UIRectCorner)corners radius:(CGSize)size; | |
| @end |
This file contains hidden or 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/UIKit.h> | |
| @interface UIView (Recursion) | |
| /** | |
| Return YES from the block to recurse into the subview. | |
| Set stop to YES to return the subview. | |
| */ | |
| - (UIView*)findViewRecursively:(BOOL(^)(UIView* subview, BOOL* stop))recurse; |
This file contains hidden or 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 NSObject (LogDealloc) | |
| - (void)logOnDealloc; | |
| @end |
NewerOlder