Skip to content

Commit

Permalink
Added documentations to explain the three offset values.
Browse files Browse the repository at this point in the history
Updated ready.
  • Loading branch information
KelvinJin committed Feb 23, 2017
1 parent c28e034 commit 90f3e57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,8 @@ collectionView.collectionViewLayout = layout

### Customization

Animators implement the protocol `LayoutAttributesAnimator`. Most of the built-in ones have additional parameters that you can tweak the transitions.
You can also write your own animators.

## TODO

- [ ] Support non-paging mode.
- [ ] Support non-full screen items.
- [ ] Support item selection notifications.
Most of the built-in animators work best in **Paging** mode and they have additional parameters that you can tweak for better transitions.
You can also write your own animators by implementing the protocol `LayoutAttributesAnimator`.

## Author

Expand Down
5 changes: 5 additions & 0 deletions Source/AnimatedCollectionViewLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,13 @@ public class AnimatedCollectionViewLayoutAttributes: UICollectionViewLayoutAttri
public var contentView: UIView?
public var scrollDirection: UICollectionViewScrollDirection = .vertical

/// The ratio of the distance between the start of the cell and the start of the collectionView and the height/width of the cell depending on the scrollDirection. It's 0 when the start of the cell aligns the start of the collectionView. It gets positive when the cell moves towards the scrolling direction (right/down) while getting negative when moves opposite.
public var startOffset: CGFloat = 0

/// The ratio of the distance between the center of the cell and the center of the collectionView and the height/width of the cell depending on the scrollDirection. It's 0 when the center of the cell aligns the center of the collectionView. It gets positive when the cell moves towards the scrolling direction (right/down) while getting negative when moves opposite.
public var middleOffset: CGFloat = 0

/// The ratio of the distance between the **start** of the cell and the end of the collectionView and the height/width of the cell depending on the scrollDirection. It's 0 when the **start** of the cell aligns the end of the collectionView. It gets positive when the cell moves towards the scrolling direction (right/down) while getting negative when moves opposite.
public var endOffset: CGFloat = 0

public override func copy(with zone: NSZone? = nil) -> Any {
Expand Down

0 comments on commit 90f3e57

Please sign in to comment.