Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions THSpringyCollectionView/THSpringyFlowLayout.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,29 @@ @implementation THSpringyFlowLayout {
}

#define kScrollRefreshThreshold 30.0f
#define kScrollResistanceCoefficient 1 / 500.0f
#define kScrollResistanceCoefficient 1 / 1000.0f

- (id)initWithCoder:(NSCoder *)aDecoder {
- (instancetype)init {
self = [super init];
if (self){
[self setup];
}
return self;
}

- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self){
_animator = [[UIDynamicAnimator alloc] initWithCollectionViewLayout:self];
_visibleIndexPaths = [NSMutableSet set];
[self setup];
}
return self;
}

- (void)setup {
_animator = [[UIDynamicAnimator alloc] initWithCollectionViewLayout:self];
_visibleIndexPaths = [NSMutableSet set];
}

- (void)prepareLayout {
[super prepareLayout];

Expand Down