Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIVisualEffectView/UIBlurEffect for overlay #20

Open
romanr opened this issue Jan 1, 2016 · 0 comments
Open

UIVisualEffectView/UIBlurEffect for overlay #20

romanr opened this issue Jan 1, 2016 · 0 comments

Comments

@romanr
Copy link
Contributor

romanr commented Jan 1, 2016

I was trying to implement blur effect for overlay, but it seems like it may require significant refactoring of initialization.

Header:

@property (assign, nonatomic) BOOL useCoverBlurEffect;
@property (assign, nonatomic) UIBlurEffectStyle coverBlurEffect;

init:

      - (instancetype)initWithNumberOfButtons:(NSUInteger)numberOfButtons
                firstButtonIsPlusButton:(BOOL)firstButtonIsPlusButton
                          showAfterInit:(BOOL)showAfterInit
                     useCoverBlurEffect:(BOOL)useCoverBlurEffect
{
    self = [super init];
    if (self)
    {

.....

_coverView = [UIView new];
        if (useCoverBlurEffect) {
            self.useCoverBlurEffect=useCoverBlurEffect;
            UIBlurEffect * effect = [UIBlurEffect effectWithStyle:_coverBlurEffect];
            _coverView = [[UIVisualEffectView alloc] initWithEffect:effect];
        }
        _coverView.backgroundColor = [UIColor clearColor];
        _coverView.userInteractionEnabled = YES;
        [self addSubview:_coverView];

this works if we pass yet another parameter to init and its gets really messy. maybe we can move inititlization of drawing to another method and call it after event moveToSuperView or something like that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant