Skip to content

Don't assert multiple transitions on RZSingleChildContainerViewController #126

@ZevEisenberg

Description

@ZevEisenberg

@Raizlabs/maintainers-ios @ndonald2 I have a bug that I'm looking that in a project where RZSingleChildContainerViewController is asserting because we're trying to initiate a transition when there is already a transition happening. The assertion is as follows:

- (void)setContentViewController:(UIViewController *)viewController animated:(BOOL)animated completion:(RZSingleChildContainerViewControllerCompletionBlock)completion
{
    if ( self.isTransitioning ) {
        [NSException raise:NSInternalInconsistencyException format:@"%@: Cannot start a transition while a transition is already in place.", [self class]];
    }

I was going to fix it in my project, but I could also fix it in this repo. I would add a single-item queue, so if you try to do a transition while another is already happening, it adds it to a "pending transition" internal property, and executes the pending transition, if any, once the current one is done. I presume it would also execute the initial completion block before the new animation starts.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions