Coder Social home page Coder Social logo

jonathanellis / stepindicator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chenyun122/stepindicator

0.0 2.0 0.0 5.81 MB

StepIndicator is an iOS library that indicates steps in an animated way.(步骤指示器)

License: MIT License

Ruby 3.37% Swift 96.63%

stepindicator's Introduction

StepIndicator

CocoaPods Compatible Platform

简体中文

StepIndicator is an iOS library that indicates steps in an animated way.
Swfit 4.1 is supported.
The idea and design are derived from the awesome Android version.

StepIndicator

Numbers supported:
StepIndicator Numbers

More directions supported(05/16/2018):
StepIndicator Directions

Installation

CocoaPods

To integrate StepIndicator into your Xcode project using CocoaPods, specify it in your Podfile:

platform :ios, '8.0'
use_frameworks!

target 'YourProjectName' do
   pod ‘StepIndicator’, '~> 1.0.6
end

And then remember to import StepIndicator module before using it.

Manually

You could directly copy and add the folder StepIndicator which contains 'StepIndicatorView.swift' file to your project.

Usage

You could use StepIndicatorView like you use UIView, create and layout it programmatically, or get everything done with Storyboard and XIB. Additionally, clone this Demo project to find out how easy it is working. It also provides a way to cooperate with UIScrollView.

Programmatically

    //......
    let stepIndicatorView = StepIndicatorView()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.stepIndicatorView.frame = CGRect(x: 0, y: 50, width: 280, height: 100)
        self.view.addSubview(self.stepIndicatorView)
        
        self.stepIndicatorView.numberOfSteps = 5
        self.stepIndicatorView.currentStep = 0
    }
    //......

Customization (Optional)

Values of following properties have been set as defaults already. Change them if they are not suitable for you.

    self.stepIndicatorView.circleColor = UIColor(red: 179.0/255.0, green: 189.0/255.0, blue: 194.0/255.0, alpha: 1.0)
    self.stepIndicatorView.circleTintColor = UIColor(red: 0.0/255.0, green: 180.0/255.0, blue: 124.0/255.0, alpha: 1.0)
    self.stepIndicatorView.circleStrokeWidth = 3.0
    self.stepIndicatorView.circleRadius = 10.0
    self.stepIndicatorView.lineColor = self.stepIndicatorView.circleColor
    self.stepIndicatorView.lineTintColor = self.stepIndicatorView.circleTintColor
    self.stepIndicatorView.lineMargin = 4.0
    self.stepIndicatorView.lineStrokeWidth = 2.0
    self.stepIndicatorView.displayNumbers = false //indicates if it displays numbers at the center instead of the core circle
    self.stepIndicatorView.direction = .leftToRight //four directions

Designable in Stroyboard and Xib (Optional)

After adding a UIView to Stroyboard or Xib, change its class to StepIndicatorView. Then you are able to config it as this demonstration:

Designable

Since Xcode(9.3) Inspector does not support enumeration options, we provide raw integer options for the directions:
Directions
0-default,left to right. 1-right to left. 2-top to bottom. 3-bottom to top.

Help

Hope you will enjoy it! Feel free to make an issue to me if you have any problems or need some improvements. And Please give the project a star if it's helpful to you, that's a great encouragement to me! ;)

License

StepIndicator is released under the MIT license. See LICENSE for details.

stepindicator's People

Contributors

jonathanellis avatar

Watchers

 avatar  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.