Created
November 24, 2011 03:25
-
-
Save azu/1390566 to your computer and use it in GitHub Desktop.
オレオレ属性をボタンなどに追加する
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
// | |
// Created by azu on 11/11/10. | |
#import <Foundation/Foundation.h> | |
@interface UIControl (oreProperty) | |
@property(nonatomic, retain) NSString *altAccessibilityHint; | |
@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
// | |
// Created by azu on 11/11/10. | |
#import <objc/runtime.h> | |
#import "UIControl+oreProperty.h" | |
@implementation UIControl (oreProperty) | |
static char UIB_PROPERTY_KEY; | |
@dynamic altAccessibilityHint; | |
- (void)setAltAccessibilityHint:(NSString *)value { | |
objc_setAssociatedObject(self, &UIB_PROPERTY_KEY, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); | |
} | |
- (NSString *)altAccessibilityHint { | |
return (NSString *) objc_getAssociatedObject(self, &UIB_PROPERTY_KEY); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment