Marxon13/M13ProgressSuite

M13ProgressViewBar doesn't reposition if navigation bar is resized.

markst opened this issue · 3 comments

Perhaps I can update to use constraints?

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Cannot modify constraints for UINavigationBar managed by a controller'
    //Check if the progress view is in its superview and if we are showing the bar.
    if (progressView.superview == nil && [self isShowingProgressBar]) {
        [progressView setTranslatesAutoresizingMaskIntoConstraints:NO];
        [self.navigationBar addSubview:progressView];
        [self.navigationBar addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[progressView]-|"
                                                                                   options:0L
                                                                                   metrics:nil
                                                                                     views:NSDictionaryOfVariableBindings(progressView)]];
        [self.navigationBar addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:[progressView(2.5)]-|"
                                                                                   options:0L
                                                                                   metrics:nil
                                                                                     views:NSDictionaryOfVariableBindings(progressView)]];

    }

this can be resolved if the progress bar is part of the navigation controller view, rather than a subview of the navigation bar & will still produce the same desired effect.