Thanks for the reply. I made a standalone project in order to strip out all my 
extraneous code. In the process I think I found my own solution.

override func initialLayoutAttributesForAppearingItemAtIndexPath(itemIndexPath: 
NSIndexPath) -> UICollectionViewLayoutAttributes?
override func 
finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath: NSIndexPath) 
-> UICollectionViewLayoutAttributes?

were not also applying the new zIndex so I think this was what was causing it.

Just thought I should post back the solution in case this comes up in a search 
for anyone else.


Thanks again,

Ted

> On 6 Aug 2015, at 16:42, Luke Hiesterman <[email protected]> wrote:
> 
> Can you post your implementations -layoutAttributesForElementsInRect: as well 
> as -layoutAttributesForItemAtIndexPath:?
> 
> Luke
> 
>> On Aug 6, 2015, at 8:09 AM, Ted Bradley <[email protected]> wrote:
>> 
>> The effect I'm trying to achieve is a kind of sticky header cell. It's 
>> important to me that the sticky cell floats over the top of the others. 
>> Something a bit like this:
>> 
>>  ┌──────────┐ 
>>  │          │ 
>>  │  Cell 0  │ 
>>  │          ├┐
>>  └┬─────────┘│
>>   │  Cell 4  │
>>   │          │
>>   └──────────┘
>>   ┌──────────┐
>>   │          │
>>   │  Cell 5  │
>>   │          │
>>   └──────────┘
>>   ┌──────────┐
>>   │          │
>>   │  Cell 6  │
>>   │          │
>>   └──────────┘
>> Cell 4, 5 and 6 would normally viewable and I'm constructing the attributes 
>> for cell 0 in my UICollectionViewFlowLayout subclass during 
>> layoutAttributesForElementsInRect:. All I do is call the super 
>> implementation, determine which cell I need to add in and then construct the 
>> UICollectionViewLayoutAttributes(forCellWithIndexPath:). I then set the 
>> zIndex for it to 1 (default is `0`).
>> 
>> The problem I'm getting is that the UICollectionView seems to always ignore 
>> the `zIndex`
>> 
>>  ┌──────────┐ 
>>  │          │ 
>>  │  Cell 0  │ 
>>  │┌─────────┴┐
>>  └┤          │
>>   │  Cell 4  │
>>   │          │
>>   └──────────┘
>>   ┌──────────┐
>>   │          │
>>   │  Cell 5  │
>>   │          │
>>   └──────────┘
>>   ┌──────────┐
>>   │          │
>>   │  Cell 6  │
>>   │          │
>>   └──────────┘
>> 
>> Now I believe it's possible to visually sort this out using a 3d transform, 
>> but that doesn't work for me as I don't want any taps going to the cell 
>> which is over the top. So in this example I don't want Cell 4 receiving taps 
>> intended for Cell 0.
>> 
>> Does anyone have any ideas? This is on iOS 8.4.
>> _______________________________________________
>> 
>> Cocoa-dev mailing list ([email protected])
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/luketheh%40apple.com
>> 
>> This email sent to [email protected]
> 


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to