CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

StatusFlow 0.0.3

StatusFlow 0.0.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2015

Maintained by Wade Weitzel.



  • By
  • Wade Weitzel

StatusFlow is an iOS implementation of a simple to use UICollectionView intended to show meaningful status that is animated and beautiful.

Alt text

Features

StatusFlow is a custom UICollectionView with a custom UICollectionViewFlowLayout.

It is intended to show incremental status, such that the "current" item is twice the size of other items in the collection view, is the selected item, and is centered horizontally and vertically within the view. The previous item is to the left of center and the next item is to the right. Other items are invisible and will fade in/fade out as the selected index is incremented. Although the setting of any selected index is supported, the control is intended to be used by incrementing or decrementing the selected index. Because it is a custom UICollectionView, any cell type is supported (although, most likely, your cell will just be a UIImageView). Since this is an informational control, user interaction is disabled.

Usage

Installation

Via direct usage

Copy the following files into your workspace, or add them as a submodule:

  • StatusFlowView.h
  • StatusFlowView.m
  • StatusFlowViewLayout.h
  • StatusFlowViewLayout.m

Creating a StatusFlow

StatusFlowView works very similar to using a UICollectionView. See the example in this project for a full project using StatusFlow.

Alt text

  1. Use storyboards to create a storyboard for the view controller the has your StatusFlow in it. Drag a UICollectionView to your view controller. This will be the status flow.
  2. Set the Custom Class -> Class property of the storyboard to WDWStatusFlow.
  3. Create an outlet from the StatusFlow to your view controller. This can be a private property.
  4. Create a cell class in XCode. It should inherit from UICollectionViewCell.
  5. Create the cell in the storyboard, and link it to the cell class using the Custom Class -> Class property.
  6. Make sure your UIViewController conforms to UICollectionViewDataSource and UICollectionViewDelegateFlowLayout (for collectionView:layout:sizeForItemAtIndexPath).
  7. In your ViewController's viewDidLoad method, use the StatusFlowView's gapBetweenCells property to define the space between each cell. The default is 5.
  8. Implement collectionView:numberOfItemsInSection. Note that there can only be ONE section.
  9. Implement collectionView:cellForItemAtIndexPath
  10. Implement collectionView:layout:sizeForItemAtIndexPath: to set the cell's size. The size of the cell is the size of the cell when it is NOT selected. It will double in size when selected. If your selected cell is larger than the collection view in width or height, it may not render properly.
  11. Increment or decrement the StatusFlowView by incrementing or decrementing the selectedIndex property of the StatusFlowView. It is recommended that you only increment or decrement this value by one (although greater jumps are supported).

Using this repo

Your machine should have the following before you begin: ruby, ruby gems, bundler

To setup the project, run the included setup.sh. This will install required Gems and perform a pod install.

$ ./setup.sh

To open the project in XCode run

$ open StatusFlow.xcworkspace

To test the project from the command line:

$ bundle exec rake

To build the project from the command line:

$ bundle exec rake build

To clean the project form the command line:

$ bundle exec rake clean

Acknowledgements

A tip of the crow to Ryan Baumbach for assistance with Travis ci.

Feedback

Got a question, suggestion, comment, or guacamole recipe? [email protected]