IGListKit/Source/IGListCollectionView.m
Ryan Nystrom 9e8ad9626a Remove iOS 7 UICollectionView delegate API support
Summary: Don't need support for iOS 7 anymore, save some cycles on layout.

Reviewed By: ocrickard

Differential Revision: D4098229

fbshipit-source-id: eeaaf875acda1229f9622f11acc7c77ccad75cf0
2016-10-29 14:59:09 -07:00

44 lines
1.3 KiB
Objective-C

/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import "IGListCollectionView.h"
@implementation IGListCollectionView
- (void)commonInit {
self.backgroundColor = [UIColor whiteColor];
self.alwaysBounceVertical = YES;
}
- (instancetype)initWithFrame:(CGRect)frame collectionViewLayout:(UICollectionViewLayout *)layout {
if (self = [super initWithFrame:frame collectionViewLayout:layout]) {
[self commonInit];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
if (self = [super initWithCoder:aDecoder]) {
[self commonInit];
}
return self;
}
- (void)layoutSubviews {
/**
UICollectionView will sometimes lay its cells out with an animation. This is especially noticeable on older devices
while scrolling quickly. The simplest fix is to just disable animations for -layoutSubviews, which is where cells
and other views inside the UICollectionView are laid out.
*/
[UIView performWithoutAnimation:^{
[super layoutSubviews];
}];
}
@end