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
| - (<#type#>)<#propertyName#> { | |
| return [objc_getAssociatedObject(self, _cmd) <#NSNumberMethod#>]; | |
| } | |
| - (void)set<#propertyName#>:(<#type#>)object | |
| { | |
| objc_setAssociatedObject(self, @selector(<#propertyName#>), [NSNumber numberWith:object], OBJC_ASSOCIATION_); | |
| } |
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
| // | |
| // UIScrollView+Extensions.h | |
| // | |
| // | |
| @interface UIScrollView (Extensions) | |
| /// Returns true if the content has been scrolled all the way to the top (by pulling the content up). | |
| - (BOOL)isScrolledToTop; |
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
| // | |
| // NSInvocation+SimpleCreation.h | |
| // MAPI | |
| // | |
| // Created by Tiago Alves on 08/12/13. | |
| // Copyright (c) 2013 Iterar. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
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 UILabel (ContentSize) | |
| - (CGSize)contentSize; | |
| @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
| // | |
| // NSObject+Association.h | |
| // | |
| // Created by Maciej Swic on 03/12/13. | |
| // Released under the MIT license. | |
| // | |
| #import <Foundation/Foundation.h> | |
| @interface NSObject (Association) |
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
| #import <Foundation/Foundation.h> | |
| @interface NSObject (Swizzle) | |
| + (void)swizzleInstanceSelector:(SEL)originalSelector | |
| withNewSelector:(SEL)newSelector; | |
| @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
| // | |
| // NSString+UsefulStuff.h | |
| // | |
| // Duane Sibilly <[email protected]> | |
| // 6/21/11 | |
| // Copyright (c) 2011-2012 Duane Sibilly. All rights reserved. | |
| #import <Foundation/Foundation.h> | |
| // The use of the parenthesis in the interface declaration is what tells the |
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
| /* | |
| Before: | |
| CGRect frame = myView.frame; | |
| frame.origin.x = newX; | |
| myView.frame = frame; | |
| After: | |
| myView.x = newX; | |
NewerOlder