Note that there are some explanatory texts on larger screens.

plurals
  1. POLayout to Layout Navigation Transitions going back to the wrong layout
    primarykey
    data
    text
    <p>I have two <code>UICollectionViewControllers</code> - lets call them master and slave. The master view controller is configured with layout A and the slave with layout B. I set <code>useLayoutToLayoutNavigationTransitions</code> on master to YES and push the slave onto the navigation stack. The layout changes from A to B and I can navigate &lt; back and see layout A. All is good.</p> <p><em>However</em>, in response to the user typing some text into a search box in the master view controller, I need to change the layout of the master collection view controller to layout C. This works as expected, but when I push the slave collection view controller onto the stack (configured with layout B) and navigate &lt; back, I end up back at the master collection view controller with layout A, not layout C, as expected.</p> <p>So far, I've tried:</p> <ul> <li>putting a symbolic breakpoint on <code>-[UICollectionView setCollectionViewLayout:]</code> (and it's related/sibling methods) to check whether something was messing with the collection view layout before pushing the slave onto the stack. I see the break point getting hit when I expect the layout to change, but nothing unusual in the process of popping the slave collection view controller off the navigation stack.</li> <li>stopping in the debugger and verifying the type of the collection view's <code>collectionViewLayout</code> property and I can see it is set to an instance of layout C before pushing the slave collection view onto the stack. After navigating backwards, I can see the layout has returned to the type of layout A and not layout C (as expected), which tallies with what I'm seeing visually.</li> <li>implementing <code>-navigationController:willShowViewController:animated:</code> delegate callback and setting the collection view layout to what's required. However this appears to get over-written.</li> <li>implementing <code>-navigationController:didShowViewController:animated:</code> and setting the collection view layout, but this results in an infinite loop and errors logged to the console.</li> </ul> <p>Does anyone have any ideas what's going on here and how to solve this? I'm wondering if it's a straight-up UIKit bug, and if so, if there are any potential workarounds.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload