Last active
August 29, 2015 13:56
-
-
Save sartak/8796085 to your computer and use it in GitHub Desktop.
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 <SpriteKit/SpriteKit.h> | |
@interface SKTexture (YWName) | |
@property (nonatomic, strong) NSString *yw_textureName; | |
@property (nonatomic, strong) NSString *yw_atlasName; | |
@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 "SKTexture+YWName.h" | |
#import <objc/runtime.h> | |
static char const * const YWAtlasNameKey; | |
static char const * const YWTextureNameKey; | |
@implementation SKTexture (YWName) | |
-(void)setYw_atlasName:(NSString *)yw_atlasName { | |
objc_setAssociatedObject(self, &YWAtlasNameKey, yw_atlasName, OBJC_ASSOCIATION_RETAIN); | |
} | |
-(void)setYw_textureName:(NSString *)yw_textureName { | |
objc_setAssociatedObject(self, &YWTextureNameKey, yw_textureName, OBJC_ASSOCIATION_RETAIN); | |
} | |
-(NSString *)yw_atlasName { | |
return objc_getAssociatedObject(self, &YWAtlasNameKey); | |
} | |
-(NSString *)yw_textureName { | |
return objc_getAssociatedObject(self, &YWTextureNameKey); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment