Giter Site home page Giter Site logo

febbyrg / statusflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from weitzel926/statusflow

0.0 2.0 0.0 3.64 MB

Control for the animated display of a series of cells used to indicate status

Ruby 7.58% Objective-C 90.01% C++ 2.24% Shell 0.17%

statusflow's Introduction

StatusFlow Build Status Cocoapod Version Cocoapod Platform License

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

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. The typical mode is horizontal, but StatusFlow now supports vertical as well.


)

Usage

Installation

Via CocoaPods (preferred)

Use CocoaPods to add StatusFlow to your project.

  1. Add the StatusFlow pod to your podfile: pod 'StatusFlow'
  2. Run pod install from your project folder to get the StatusFlow pod: pod install
  3. Open your project in XCode using the workspace instead of the project file: open <your_project>.xcworkspace
  4. #import <StatusFlow/WDWStatusFlowView.h> to use StatusFlow
Via direct usage

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

  • WDWStatusFlowView.h
  • WDWStatusFlowView.m
  • WDWStatusFlowViewLayout.h
  • WDWStatusFlowViewLayout.m
  • WDWStatusFlowEnum.h

Creating a StatusFlow

WDWStatusFlowView 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 WDWStatusFlowView.
  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 WDWStatusFlowView's gapBetweenCells property to define the space between each cell. The default is 5.
  8. In your ViewController's viewDidLoad method, you can set the direction property on your StatusFlowView object to either WDWStatusFlowViewDirectionHorizontal or WDWStatusFlowViewDirectionVertical. It will be horizontal by default.
  9. Implement collectionView:numberOfItemsInSection. Note that there can only be ONE section.
  10. Implement collectionView:cellForItemAtIndexPath
  11. 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.
  12. Increment or decrement the WDWStatusFlowView 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

Version history

Version history can be found in the wiki

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]

statusflow's People

Contributors

weitzel926 avatar

Watchers

James Cloos avatar Febby Rachmat Gumilar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.