iCarousel icon indicating copy to clipboard operation
iCarousel copied to clipboard

iCarousel dissapears in IOS 11

Open JeeGee1983 opened this issue 7 years ago • 9 comments

With an iCarousel object in my ViewController, the carousel dissappears when presenting an UIAlertController (UIAlertControllerStyleActionSheet) or UIPopoverController. The function reloadData has to be called to get it back.

Any idea how this can be solved?

JeeGee1983 avatar Sep 25 '17 18:09 JeeGee1983

Nobody?

JeeGee1983 avatar Oct 02 '17 15:10 JeeGee1983

@JeeGee1983 I'm also having this issue in one of the older apps I support. Have you found a workaround? I only see this issue on iOS 11.

Zbeyer avatar Oct 06 '17 17:10 Zbeyer

@Zbeyer, unfortunately not. I’m reloading the carousel every time after dismissing the UIAlertController or PopoverController. Not I nice solution because when doing this, the items flash.

I have send an email to Charcoal Design to ask if they have any idea where to look for a solution.

JeeGee1983 avatar Oct 06 '17 17:10 JeeGee1983

Yeah, that's not something that will work for me. :|

Zbeyer avatar Oct 06 '17 18:10 Zbeyer

@Zbeyer, found a solution already?

JeeGee1983 avatar Nov 05 '17 17:11 JeeGee1983

I'm also having this issue. With an iCarousel object in tableViewCell, the carousel dissappears when cell recycled

joywt avatar Nov 20 '17 09:11 joywt

@JeeGee1983 I ended up doing something similar. Had to re-write instances where popovers are generated and in the constructors and deconstructors raise events using NSNotificationCenter that trigger iCarousel to redraw.

Like @JeeGee1983, now the items flash whenever a popover is opened or dismissed, however the users are now able to access their content. To my knowledge this is the only working solution anyone has come up with, correct?

- (void)viewWillAppear:(BOOL)animated {
...
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadCarousel) name:kPopoverReDrawNotification object:nil];
}
- (void)reloadCarousel {
    //iOS 11 introduced break in iCarousel when a popover appears or disappears. The only known workaround is the force iCarousel to redraw as part of the popover
    [self.carousel reloadData];
}

Where possible, I used existing delegate methods to post the notification:

#pragma mark - PopoverDelegate
- (void) popoverControllerDidDismissPopover:(UIPopoverController *)popoverController {
    [[NSNotificationCenter defaultCenter] postNotificationName:kPopoverReDrawNotification object:nil];
}

Zbeyer avatar Dec 04 '17 18:12 Zbeyer

Hi, I m planning to integrate this iCarousel. Does this issue remain? Any fixes about the items flash behaviour?

doudouperrin avatar Feb 23 '18 13:02 doudouperrin

My solution is creating a new window, put this window above current window, and set UIAlertController to the root view controller of this window. After some debugging, I found the reason why the carousel disappear is that after presenting a view controller, system implicitly clears all the animations attached to the views below. Carousel just layouts its sub views by animations! If anyone still get stuck by this issue, can ask me for some sample codes.

zwo avatar Jan 19 '19 11:01 zwo