Code Monkey home page Code Monkey logo

mkmagneticprogress's Introduction

MKMagneticProgress

Version License Platform

MKMagneticProgress

A circular progress bar for iOS written in Swift

Features

  • Interface builder designable
  • Highly customizable and flexible
  • Easy to use
  • Written in Swift

Installation

CocoaPods (Recommended)

  1. Install CocoaPods
  2. Add this repo to your Podfile
target 'Example' do
# IMPORTANT: Make sure use_frameworks! is included at the top of the file
use_frameworks!
platform :ios, '8.0'
pod 'MKMagneticProgress'
end
  1. Run pod install
  2. Open up the .xcworkspace that CocoaPods created
  3. Done!

Manually

Simply download the MKMagneticProgress.swift file from here into your project, make sure you point to your projects target

Usage

Interface Builder

Simply drag a UIView into your storyboard. Make sure to subclass MKMagneticProgress and that the module points MKMagneticProgress.

Design your heart out

ib-demo.gif

Usage

import MKMagneticProgress


@IBOutlet weak var magProgress:MKMagneticProgress!

override func viewDidLoad() {
    magProgress.setProgress(progress: 0.5, animated: true)
    magProgress.progressShapeColor = UIColor.blue
    magProgress.backgroundShapeColor = UIColor.yellow
    magProgress.titleColor = UIColor.red
    magProgress.percentColor = UIColor.black

    magProgress.lineWidth = 10
    magProgress.orientation = .top
    magProgress.lineCap = .round

    magProgress.title = "Title"
    magProgress.percentLabelFormat = "%.2f%%"

}

Example project

Take a look at the example project over here

  1. Download it
  2. Open the Example.xcworkspace in Xcode
  3. Enjoy!

Author

Moayad Al kouz, [email protected]

Twitter : @malkouz

License

MKMagneticProgress is available under the MIT license. See the LICENSE file for more info.

mkmagneticprogress's People

Contributors

alireza12t avatar lahiruchathuranga avatar malkouz avatar zorn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mkmagneticprogress's Issues

Animation Issue

when set progress with animation property true it is not working self.circularProgeress.setProgress(progress: 0.7, animated: true). If it is false progress working fine.

got 5 errors in your file

##1
public enum LineCap : Int{
case round, butt, square

public func style() -> String {
    switch self {
    case .round:
        return CAShapeLayerLineCap.round.rawValue
    case .butt:
        return CAShapeLayerLineCap.butt.rawValue
    case .square:
        return CAShapeLayerLineCap.square.rawValue
    }
}

}

##2

private func updateShapes() {
backgroundShape?.lineWidth = lineWidth
backgroundShape?.strokeColor = backgroundShapeColor.cgColor
//backgroundShape?.lineCap = lineCap.style()

    progressShape?.strokeColor = progressShapeColor.cgColor
    progressShape?.lineWidth   = lineWidth - inset
   // progressShape?.lineCap     = lineCap.style()
    
    switch orientation {

the above code is changed in my system and two line need to comment

Completion Handler

Hi,
Thanks for your perfect job here.
I use this progress for a circular audio buffer
In the case of AVPlayerItemDidPlayToEndTime notification, i want to progress to end and then to 0, but there is no completion handler to know when animation finished
How can i get animation finish time

Percent label font

Hi @malkouz ,
thank you for this library.

How can I customize font for percent label? I'd like to choose system font with medium or bold weight, non regular.

Thank you.

Animation and refill issue for progress bar..

I am using MKMagneticProgress library for show progress in UITableviewCell in reusable cell.
In this case progress bar reset issue in coming for set fill again on scroll tableview.

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.