Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions REFrostedViewController/REFrostedContainerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ - (void)viewDidLoad
[self.containerView addSubview:toolbar];
} else {
self.backgroundImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
self.containerView.backgroundColor = self.frostedViewController.backgroundContainerColor;
[self.containerView addSubview:self.backgroundImageView];
}

Expand Down
1 change: 1 addition & 0 deletions REFrostedViewController/REFrostedViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ typedef NS_ENUM(NSInteger, REFrostedViewControllerLiveBackgroundStyle) {
* The default value is 0.3.
*/
@property (assign, readwrite, nonatomic) CGFloat backgroundFadeAmount;
@property (assign, readwrite, nonatomic) UIColor *backgroundContainerColor;//take the priority insteed of liveBlur, if we want a specific opaque background
@property (strong, readwrite, nonatomic) UIColor *blurTintColor; // Used only when live blur is off
@property (assign, readwrite, nonatomic) CGFloat blurRadius; // Used only when live blur is off
@property (assign, readwrite, nonatomic) CGFloat blurSaturationDeltaFactor; // Used only when live blur is off
Expand Down
8 changes: 4 additions & 4 deletions REFrostedViewController/REFrostedViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ - (void)commonInit
_containerViewController = [[REFrostedContainerViewController alloc] init];
_containerViewController.frostedViewController = self;
_menuViewSize = CGSizeZero;
_liveBlur = REUIKitIsFlatMode();
_liveBlur = NO;
_panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:_containerViewController action:@selector(panGestureRecognized:)];
_automaticSize = YES;
}
Expand Down Expand Up @@ -189,7 +189,7 @@ - (void)presentMenuViewControllerWithAnimatedApperance:(BOOL)animateApperance
_menuViewSize.height > 0 ? _menuViewSize.height : self.contentViewController.view.frame.size.height);
}

if (!self.liveBlur) {
if (self.liveBlur && !self.backgroundContainerColor) {
if (REUIKitIsFlatMode() && !self.blurTintColor) {
self.blurTintColor = [UIColor colorWithWhite:1 alpha:0.75f];
}
Expand All @@ -205,7 +205,7 @@ - (void)hideMenuViewControllerWithCompletionHandler:(void(^)(void))completionHan
if (!self.visible) {//when call hide menu before menuViewController added to containerViewController, the menuViewController will never added to containerViewController
return;
}
if (!self.liveBlur) {
if (self.liveBlur && !self.frostedViewController.backgroundContainerColor) {
self.containerViewController.screenshotImage = [[self.contentViewController.view re_screenshot] re_applyBlurWithRadius:self.blurRadius tintColor:self.blurTintColor saturationDeltaFactor:self.blurSaturationDeltaFactor maskImage:nil];
[self.containerViewController refreshBackgroundImage];
}
Expand All @@ -214,7 +214,7 @@ - (void)hideMenuViewControllerWithCompletionHandler:(void(^)(void))completionHan

- (void)resizeMenuViewControllerToSize:(CGSize)size
{
if (!self.liveBlur) {
if (self.liveBlur && !self.frostedViewController.backgroundContainerColor) {
self.containerViewController.screenshotImage = [[self.contentViewController.view re_screenshot] re_applyBlurWithRadius:self.blurRadius tintColor:self.blurTintColor saturationDeltaFactor:self.blurSaturationDeltaFactor maskImage:nil];
[self.containerViewController refreshBackgroundImage];
}
Expand Down