JackieQi / GPaperTrans

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GPaperTrans

Yet another UICollectionView layout transitions inspired by Facebook Paper App in Swift

Demo GPaperTrans

How to run

Please do not forget to run "pods install" before running the program. You can try "Standard" first. Then, you can try "Responsive"

I hope you will notice two differenes.

  • "Responsive" would be a little bit more responsive to gesture.
  • In "Standard", you will notice some of the swipe will be ignored.

How it works

This is basically UICollectionView layout to layout transition. (like taktamur/PAMTransitionSample[https://github.com/taktamur/PAMTransitionSample])

There are two main differences.

  1. AsynchNode from facebook is used in "Responsive" version instead of UIImageView. This makes transition a little bit more responsive. (Very subtle difference)

2)In "Standard" version, UICollectionView.finishInteractiveTransition() is called after UIPanGestureRecoginizer returned UIGestureRecognizerState.Ended.

Since finishing animation takes longer than expected, when the user begins new interaction before the animation finishes, it will be ignored.

In "Responsive" version, most of the finishing animation is controlled by Pop (also by Facebook). Since animation by pop can be interrupted, swipe action will not be ignored (in most cases. I admit still some of the swipe is ignored)

Todo

  • Use ASCollectionView

Requirements

  • iOS 8 or higher
  • ARC

Contact me

Goro Otsubo

License

This software is released under the MIT License, see LICENSE.txt.

About

License:MIT License


Languages

Language:Swift 98.6%Language:Objective-C 1.1%Language:Ruby 0.3%