Files
my_yuyin/Pods/YBImageBrowser/YBImageBrowser/Base/NSObject+YBImageBrowser.m
2025-09-22 18:48:29 +08:00

24 lines
636 B
Objective-C

//
// NSObject+YBImageBrowser.m
// YBImageBrowserDemo
//
// Created by 波儿菜 on 2019/9/26.
// Copyright © 2019 杨波. All rights reserved.
//
#import "NSObject+YBImageBrowser.h"
#import <objc/runtime.h>
@implementation NSObject (YBImageBrowser)
static void *YBIBOriginAlphaKey = &YBIBOriginAlphaKey;
- (void)setYbib_originAlpha:(CGFloat)ybib_originAlpha {
objc_setAssociatedObject(self, YBIBOriginAlphaKey, @(ybib_originAlpha), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (CGFloat)ybib_originAlpha {
NSNumber *alpha = objc_getAssociatedObject(self, YBIBOriginAlphaKey);
return alpha ? alpha.floatValue : 1;
}
@end