Created
May 16, 2012 18:54
-
-
Save hiddenmemory/2712991 to your computer and use it in GitHub Desktop.
ResourceHelper - applyBorderOffset
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 <UIKit/UIKit.h> | |
@interface UIView (ResourceHelper) | |
- (void)rh_applyBorderOffset:(CGRect)offset; | |
@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
#import "UIView+ResourceHelper.h" | |
@implementation UIView (ResourceHelper) | |
- (void)rh_applyBorderOffset:(CGRect)offset { | |
CGRect originalFrame = self.frame; | |
originalFrame.origin.x -= offset.origin.x; | |
originalFrame.origin.y -= offset.origin.y; | |
originalFrame.size.width += (offset.size.width * 2); | |
originalFrame.size.height += (offset.size.height * 2); | |
self.frame = originalFrame; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment