File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 4
4
5
5
@implementation BlurView {
6
6
UIVisualEffectView *_visualEffectView;
7
- BlurView * blurEffect;
7
+ UIBlurEffect * blurEffect;
8
8
}
9
9
10
10
- (void )setBlurType : (NSString *)blurType
@@ -22,21 +22,18 @@ - (void)setBlurType:(NSString *)blurType
22
22
} else {
23
23
blurEffect = [BlurAmount effectWithStyle: UIBlurEffectStyleDark];
24
24
}
25
-
25
+
26
+ dispatch_async (dispatch_get_main_queue (), ^{
27
+ _visualEffectView = [[UIVisualEffectView alloc ] initWithEffect: blurEffect];
28
+ _visualEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
29
+ _visualEffectView.frame = self.bounds ;
30
+ [self insertSubview: _visualEffectView atIndex: 0 ];
31
+ });
26
32
}
27
33
28
34
- (void )setBlurAmount : (NSNumber *)blurAmount
29
35
{
30
36
[BlurAmount updateBlurAmount: blurAmount];
31
37
}
32
38
33
-
34
- - (void )layoutSubviews
35
- {
36
- [super layoutSubviews ];
37
- _visualEffectView = [[UIVisualEffectView alloc ] initWithEffect: blurEffect];
38
- _visualEffectView.frame = self.bounds ;
39
- [self insertSubview: _visualEffectView atIndex: 0 ];
40
- }
41
-
42
39
@end
You can’t perform that action at this time.
0 commit comments