Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions ANBlurredImageView/ANBlurredImageView.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ - (id)initWithFrame:(CGRect)frame
return self;
}

-(void)layoutSubviews{
[super layoutSubviews];
- (void)willMoveToSuperview:(UIView *)newSuperview {
[super willMoveToSuperview:newSuperview];

_baseImage = self.image;
[self generateBlurFramesWithCompletion:^{}];

// Defaults
self.animationDuration = 0.1f;
self.animationRepeatCount = 1;
if (newSuperview) {
_baseImage = self.image;
[self generateBlurFramesWithCompletion:^{}];

// Defaults
self.animationDuration = 0.1f;
self.animationRepeatCount = 1;
}
}

// Downsamples the image so we avoid needing to blur a huge image.
Expand Down