Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable the animations in an NSCollectionView

I would like to turn off the 'shuffle' animations that happen when you resize an NSCollectionView. Is this possible?

like image 906
Daniel Jette Avatar asked Feb 03 '23 20:02

Daniel Jette


2 Answers

This works, but it's setting a private instance variable so it may no be ok in the Mac App Store.

[collectionView setValue:@(0) forKey:@"_animationDuration"];
like image 95
Padraig Avatar answered Feb 13 '23 15:02

Padraig


kainjow is correct. adding this:

- (id) animationForKey:(NSString *) key
{
    return nil;
}

to the prototype view subclass (not the collection view!) disables animations

like image 28
TheSavage Avatar answered Feb 13 '23 14:02

TheSavage