rnystrom / RNFrostedSidebar

A Control Center-esque control with blurred background and toggle animations.
MIT License
2.12k stars 340 forks source link

Inconsistent behavior #35

Closed skull-squadron closed 10 years ago

skull-squadron commented 10 years ago

First, this control is great. Thanks for publishing and supporting it.

The behavior is that either the sidebar does not appear completely or it appears behind the VC but mixes transparency underneath the status bar only. If the current VC is the initial VC, everything works fine. Then after the current VC is dismissed, N (== # button presses) sidebars appear on top of the VC/s underneath.

Until proven otherwise, I assume I'm doing something wrong (PEBKAC).

Update: I'll run this app through Reveal to see if that helps.

Current VC:

- (NSArray *)settingsImagesFilenames {
    return @[@"first", @"second"];
}

- (NSArray *)settingsImages {  // TODO: memoize
    NSMutableArray *result = @[].mutableCopy;
    for (NSString *filename in self.settingsImagesFilenames) {
        [result addObject:[UIImage imageNamed:filename]];
    }
    return result;
}

// wired to a settings button touch up inside
- (IBAction)settingsButtonPressed:(id)sender {
    NSLog(@"RNFrostedSidebar: settings button pressed");
    RNFrostedSidebar *callout = [[RNFrostedSidebar alloc] initWithImages:self.settingsImages];
    callout.delegate = self;
    [callout show];
}

- (void)sidebar:(RNFrostedSidebar *)sidebar didTapItemAtIndex:(NSUInteger)index {
    NSLog(@"RNFrostedSidebar: didTapItemAtIndex tapped: %d", index);
    [sidebar dismissAnimated:YES];
}
skull-squadron commented 10 years ago

Videos

Working

Not working

skull-squadron commented 10 years ago

Here's the "not working" in Reveal:

img

skull-squadron commented 10 years ago

Workaround: [self.sidebar showInViewController:self animated:YES];

Not worth fixing. Also, apps should dispose of VC's that aren't visible.