- Fix dealloc crash
This commit is contained in:
1 parent
52ac833f7c
commit
afddd1e959
1 file changed
+1
-5
@@ -9,8 +9,6 @@
|
|||||||
#import "GradientButton.h"
|
#import "GradientButton.h"
|
||||||
#import "PureLayout.h"
|
#import "PureLayout.h"
|
||||||
|
|
||||||
static char ClassNameKVOContext = 0;
|
|
||||||
|
|
||||||
@interface GradientButton()
|
@interface GradientButton()
|
||||||
|
|
||||||
@property (nonatomic, strong) CAGradientLayer *gradientLayer;
|
@property (nonatomic, strong) CAGradientLayer *gradientLayer;
|
||||||
@@ -114,11 +112,9 @@ static char ClassNameKVOContext = 0;
|
|||||||
|
|
||||||
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
||||||
{
|
{
|
||||||
if (context == ClassNameKVOContext && object == self && [keyPath isEqualToString:@"bounds"]) {
|
if (object == self && [keyPath isEqualToString:@"bounds"]) {
|
||||||
if(_gradientLayer) {
|
if(_gradientLayer) {
|
||||||
|
|
||||||
[self setbackgroundLayerWithColors:_colors startPoint:_startPoint];
|
[self setbackgroundLayerWithColors:_colors startPoint:_startPoint];
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user