Giter Site home page Giter Site logo

progressstepview's Introduction

ProgressStepView

A library for creating progress with steps.

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate ProgressStepView into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'ProgressStepView', '~> 1.0.0'

Requirements

  • iOS 10.0 or later
  • Xcode 10.0 or later

How To Use

  • Swift
import ProgressStepView

private lazy var progress: ProgressStepView = {
    let progress = ProgressStepView(frame: viewTeste.bounds)
    progress.numberOfPoints = 4
    progress.spacing = 5.0
    progress.progressLineHeight = 8
    progress.circleRadius = 20
    progress.circleStrokeWidth = 2.5
    progress.translatesAutoresizingMaskIntoConstraints = false

    return progress
}()

view.addSubview(progress)

NSLayoutConstraint.activate([
    progress.topAnchor.constraint(equalTo: view.topAnchor, constant: 100),
    progress.leadingAnchor.constraint(equalTo: view.leadingAnchor),
    progress.trailingAnchor.constraint(equalTo: view.trailingAnchor)
])

progress.progress = 0.5

Customization

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

progress.numberOfPoints = 4
progress.spacing = 5.0
progress.progressLineHeight = 8
progress.progressCornerRadius = 4
progress.circleRadius = 20
progress.circleStrokeWidth = 2.5
progress.circleTintColor = #colorLiteral(red: 0, green: 0.4784313725, blue: 1, alpha: 1)
progress.circleColor = #colorLiteral(red: 0.6000000238, green: 0.6000000238, blue: 0.6000000238, alpha: 1)
progress.descriptionSpacing = 10.0
progress.descriptionColor = .black
progress.descriptionFont = UIFont.systemFont(ofSize: 15, weight: .bold)
progress.position = .top

Add Description

Implement delegate, choose position

progress.position = .bottom

progress.position = .top

progress.delegate = self
progress.position = .bottom

...

extension ViewController: ProgressStepViewDelegate {
    func progressStepView(descriptionForRow row: Int) -> String? {
        return "Number \(row)"
    }
}

License

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

progressstepview's People

Contributors

gustavosas avatar

Stargazers

Igor Sсhäfer avatar kkm avatar Ignatio Julian avatar Anderson Kloss Maia avatar  avatar  avatar belal medhat avatar Renato Mendes avatar  avatar Rick avatar Gustavo Alochio avatar Gilmarllen Pereira Miotto avatar

Watchers

James Cloos avatar  avatar

progressstepview's Issues

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.