├── .gitignore ├── .swift-version ├── BaseView.swift ├── Determinate ├── CircularProgressView.swift ├── DeterminateAnimation.swift └── ProgressBar.swift ├── Images ├── CircularProgress.png ├── CircularSnail.gif ├── Crawler.gif ├── DeterminateProgress.png ├── ProgressBar.png ├── Rainbow.gif ├── RotatingArc.gif ├── ShootingStars.gif ├── Spinner.gif ├── banner.gif └── indeterminate.gif ├── InDeterminate ├── Crawler.swift ├── IndeterminateAnimation.swift ├── MaterialProgress.swift ├── Rainbow.swift ├── RotatingArc.swift ├── ShootingStars.swift └── Spinner.swift ├── LICENSE ├── ProgressKit.podspec ├── ProgressKit.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── ProgressKit ├── AppDelegate.swift ├── Base.lproj │ └── Main.storyboard ├── Determinate.swift ├── DeterminateVC.swift ├── InDeterminate.swift ├── InDeterminateVC.swift └── Info.plist ├── ProgressKitTests ├── Info.plist └── ProgressKitTests.swift ├── ProgressUtils.swift └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | # Xcode 3 | # 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.hmap 18 | *.ipa 19 | *.xcuserstate 20 | 21 | # CocoaPods 22 | # 23 | # We recommend against adding the Pods directory to your .gitignore. However 24 | # you should judge for yourself, the pros and cons are mentioned at: 25 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 26 | # 27 | # Pods/ 28 | 29 | # Carthage 30 | # 31 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 32 | # Carthage/Checkouts 33 | 34 | Carthage/Build 35 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /BaseView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseView.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 04/10/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import AppKit 10 | 11 | @IBDesignable 12 | open class BaseView : NSView { 13 | 14 | override public init(frame frameRect: NSRect) { 15 | super.init(frame: frameRect) 16 | self.configureLayers() 17 | } 18 | 19 | required public init?(coder: NSCoder) { 20 | super.init(coder: coder) 21 | self.configureLayers() 22 | } 23 | 24 | /// Configure the Layers 25 | func configureLayers() { 26 | self.wantsLayer = true 27 | notifyViewRedesigned() 28 | } 29 | 30 | @IBInspectable open var background: NSColor = NSColor(red: 88.3 / 256, green: 104.4 / 256, blue: 118.5 / 256, alpha: 1.0) { 31 | didSet { 32 | self.notifyViewRedesigned() 33 | } 34 | } 35 | 36 | @IBInspectable open var foreground: NSColor = NSColor(red: 66.3 / 256, green: 173.7 / 256, blue: 106.4 / 256, alpha: 1.0) { 37 | didSet { 38 | self.notifyViewRedesigned() 39 | } 40 | } 41 | 42 | @IBInspectable open var cornerRadius: CGFloat = 5.0 { 43 | didSet { 44 | self.notifyViewRedesigned() 45 | } 46 | } 47 | 48 | /// Call when any IBInspectable variable is changed 49 | func notifyViewRedesigned() { 50 | self.layer?.backgroundColor = background.cgColor 51 | self.layer?.cornerRadius = cornerRadius 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Determinate/CircularProgressView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CircularView.swift 3 | // Animo 4 | // 5 | // Created by Kauntey Suryawanshi on 29/06/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | @IBDesignable 13 | open class CircularProgressView: DeterminateAnimation { 14 | 15 | open var backgroundCircle = CAShapeLayer() 16 | open var progressLayer = CAShapeLayer() 17 | open var percentLabelLayer = CATextLayer() 18 | 19 | @IBInspectable open var strokeWidth: CGFloat = -1 { 20 | didSet { 21 | notifyViewRedesigned() 22 | } 23 | } 24 | 25 | @IBInspectable open var showPercent: Bool = true { 26 | didSet { 27 | notifyViewRedesigned() 28 | } 29 | } 30 | 31 | override func notifyViewRedesigned() { 32 | super.notifyViewRedesigned() 33 | backgroundCircle.lineWidth = self.strokeWidth / 2 34 | progressLayer.lineWidth = strokeWidth 35 | percentLabelLayer.isHidden = !showPercent 36 | 37 | backgroundCircle.strokeColor = foreground.withAlphaComponent(0.5).cgColor 38 | progressLayer.strokeColor = foreground.cgColor 39 | percentLabelLayer.foregroundColor = foreground.cgColor 40 | } 41 | 42 | override func updateProgress() { 43 | CATransaction.begin() 44 | if animated { 45 | CATransaction.setAnimationDuration(0.5) 46 | } else { 47 | CATransaction.setDisableActions(true) 48 | } 49 | let timing = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut) 50 | CATransaction.setAnimationTimingFunction(timing) 51 | progressLayer.strokeEnd = max(0, min(progress, 1)) 52 | percentLabelLayer.string = "\(Int(progress * 100))%" 53 | CATransaction.commit() 54 | } 55 | 56 | override func configureLayers() { 57 | super.configureLayers() 58 | let rect = self.bounds 59 | let radius = (rect.width / 2) * 0.75 60 | let strokeScalingFactor = CGFloat(0.05) 61 | 62 | 63 | // Add background Circle 64 | do { 65 | backgroundCircle.frame = rect 66 | backgroundCircle.lineWidth = strokeWidth == -1 ? (rect.width * strokeScalingFactor / 2) : strokeWidth / 2 67 | 68 | backgroundCircle.strokeColor = foreground.withAlphaComponent(0.5).cgColor 69 | backgroundCircle.fillColor = NSColor.clear.cgColor 70 | let backgroundPath = NSBezierPath() 71 | backgroundPath.appendArc(withCenter: rect.mid, radius: radius, startAngle: 0, endAngle: 360) 72 | backgroundCircle.path = backgroundPath.CGPath 73 | self.layer?.addSublayer(backgroundCircle) 74 | } 75 | 76 | // Progress Layer 77 | do { 78 | progressLayer.strokeEnd = 0 //REMOVe this 79 | progressLayer.fillColor = NSColor.clear.cgColor 80 | progressLayer.lineCap = .round 81 | progressLayer.lineWidth = strokeWidth == -1 ? (rect.width * strokeScalingFactor) : strokeWidth 82 | 83 | progressLayer.frame = rect 84 | progressLayer.strokeColor = foreground.cgColor 85 | let arcPath = NSBezierPath() 86 | let startAngle = CGFloat(90) 87 | arcPath.appendArc(withCenter: rect.mid, radius: radius, startAngle: startAngle, endAngle: (startAngle - 360), clockwise: true) 88 | progressLayer.path = arcPath.CGPath 89 | self.layer?.addSublayer(progressLayer) 90 | } 91 | 92 | // Percentage Layer 93 | do { 94 | percentLabelLayer.string = "0%" 95 | percentLabelLayer.foregroundColor = foreground.cgColor 96 | percentLabelLayer.frame = rect 97 | percentLabelLayer.font = "Helvetica Neue Light" as CFTypeRef 98 | percentLabelLayer.alignmentMode = CATextLayerAlignmentMode.center 99 | percentLabelLayer.position.y = rect.midY * 0.25 100 | percentLabelLayer.fontSize = rect.width * 0.2 101 | self.layer?.addSublayer(percentLabelLayer) 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Determinate/DeterminateAnimation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DeterminateAnimation.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 09/07/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | protocol DeterminableAnimation { 13 | func updateProgress() 14 | } 15 | 16 | @IBDesignable 17 | open class DeterminateAnimation: BaseView, DeterminableAnimation { 18 | 19 | @IBInspectable open var animated: Bool = true 20 | 21 | /// Value of progress now. Range 0..1 22 | @IBInspectable open var progress: CGFloat = 0 { 23 | didSet { 24 | updateProgress() 25 | } 26 | } 27 | 28 | /// This function will only be called by didSet of progress. Every subclass will have its own implementation 29 | func updateProgress() { 30 | fatalError("Must be overriden in subclass") 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Determinate/ProgressBar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProgressBar.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 31/07/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | @IBDesignable 13 | open class ProgressBar: DeterminateAnimation { 14 | 15 | open var borderLayer = CAShapeLayer() 16 | open var progressLayer = CAShapeLayer() 17 | 18 | @IBInspectable open var borderColor: NSColor = .black { 19 | didSet { 20 | notifyViewRedesigned() 21 | } 22 | } 23 | 24 | override func notifyViewRedesigned() { 25 | super.notifyViewRedesigned() 26 | self.layer?.cornerRadius = self.frame.height / 2 27 | borderLayer.borderColor = borderColor.cgColor 28 | progressLayer.backgroundColor = foreground.cgColor 29 | } 30 | 31 | override func configureLayers() { 32 | super.configureLayers() 33 | 34 | borderLayer.frame = self.bounds 35 | borderLayer.cornerRadius = borderLayer.frame.height / 2 36 | borderLayer.borderWidth = 1.0 37 | self.layer?.addSublayer(borderLayer) 38 | 39 | progressLayer.frame = NSInsetRect(borderLayer.bounds, 3, 3) 40 | progressLayer.frame.size.width = (borderLayer.bounds.width - 6) 41 | progressLayer.cornerRadius = progressLayer.frame.height / 2 42 | progressLayer.backgroundColor = foreground.cgColor 43 | borderLayer.addSublayer(progressLayer) 44 | 45 | } 46 | 47 | override func updateProgress() { 48 | CATransaction.begin() 49 | if animated { 50 | CATransaction.setAnimationDuration(0.5) 51 | } else { 52 | CATransaction.setDisableActions(true) 53 | } 54 | let timing = CAMediaTimingFunction(name: .easeOut) 55 | CATransaction.setAnimationTimingFunction(timing) 56 | progressLayer.frame.size.width = (borderLayer.bounds.width - 6) * progress 57 | CATransaction.commit() 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Images/CircularProgress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/CircularProgress.png -------------------------------------------------------------------------------- /Images/CircularSnail.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/CircularSnail.gif -------------------------------------------------------------------------------- /Images/Crawler.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/Crawler.gif -------------------------------------------------------------------------------- /Images/DeterminateProgress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/DeterminateProgress.png -------------------------------------------------------------------------------- /Images/ProgressBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/ProgressBar.png -------------------------------------------------------------------------------- /Images/Rainbow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/Rainbow.gif -------------------------------------------------------------------------------- /Images/RotatingArc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/RotatingArc.gif -------------------------------------------------------------------------------- /Images/ShootingStars.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/ShootingStars.gif -------------------------------------------------------------------------------- /Images/Spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/Spinner.gif -------------------------------------------------------------------------------- /Images/banner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/banner.gif -------------------------------------------------------------------------------- /Images/indeterminate.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaunteya/ProgressKit/f19f111ec32af8dc8511702f2fcb0ccd372babb5/Images/indeterminate.gif -------------------------------------------------------------------------------- /InDeterminate/Crawler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Crawler.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 11/07/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | private let defaultForegroundColor = NSColor.white 13 | private let defaultBackgroundColor = NSColor(white: 0.0, alpha: 0.4) 14 | private let duration = 1.2 15 | 16 | @IBDesignable 17 | open class Crawler: IndeterminateAnimation { 18 | 19 | var starList = [CAShapeLayer]() 20 | 21 | var smallCircleSize: Double { 22 | return Double(self.bounds.width) * 0.2 23 | } 24 | 25 | var animationGroups = [CAAnimation]() 26 | 27 | override func notifyViewRedesigned() { 28 | super.notifyViewRedesigned() 29 | for star in starList { 30 | star.backgroundColor = foreground.cgColor 31 | } 32 | } 33 | 34 | override func configureLayers() { 35 | super.configureLayers() 36 | let rect = self.bounds 37 | let insetRect = NSInsetRect(rect, rect.width * 0.15, rect.width * 0.15) 38 | 39 | for i in 0 ..< 5 { 40 | let starShape = CAShapeLayer() 41 | starList.append(starShape) 42 | starShape.backgroundColor = foreground.cgColor 43 | 44 | let circleWidth = smallCircleSize - Double(i) * 2 45 | starShape.bounds = CGRect(x: 0, y: 0, width: circleWidth, height: circleWidth) 46 | starShape.cornerRadius = CGFloat(circleWidth / 2) 47 | starShape.position = CGPoint(x: rect.midX, y: rect.midY + insetRect.height / 2) 48 | self.layer?.addSublayer(starShape) 49 | 50 | let arcPath = NSBezierPath() 51 | arcPath.appendArc(withCenter: insetRect.mid, radius: insetRect.width / 2, startAngle: 90, endAngle: -360 + 90, clockwise: true) 52 | 53 | let rotationAnimation = CAKeyframeAnimation(keyPath: "position") 54 | rotationAnimation.path = arcPath.CGPath 55 | rotationAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut) 56 | rotationAnimation.beginTime = (duration * 0.075) * Double(i) 57 | rotationAnimation.calculationMode = .cubicPaced 58 | 59 | let animationGroup = CAAnimationGroup() 60 | animationGroup.animations = [rotationAnimation] 61 | animationGroup.duration = duration 62 | animationGroup.repeatCount = .infinity 63 | animationGroups.append(animationGroup) 64 | 65 | } 66 | } 67 | 68 | override func startAnimation() { 69 | for (index, star) in starList.enumerated() { 70 | star.add(animationGroups[index], forKey: "") 71 | } 72 | } 73 | 74 | override func stopAnimation() { 75 | for star in starList { 76 | star.removeAllAnimations() 77 | } 78 | } 79 | } 80 | 81 | -------------------------------------------------------------------------------- /InDeterminate/IndeterminateAnimation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InDeterminateAnimation.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 09/07/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | protocol AnimationStatusDelegate { 12 | func startAnimation() 13 | func stopAnimation() 14 | } 15 | 16 | open class IndeterminateAnimation: BaseView, AnimationStatusDelegate { 17 | 18 | /// View is hidden when *animate* property is false 19 | @IBInspectable open var displayAfterAnimationEnds: Bool = false 20 | 21 | /** 22 | Control point for all Indeterminate animation 23 | True invokes `startAnimation()` on subclass of IndeterminateAnimation 24 | False invokes `stopAnimation()` on subclass of IndeterminateAnimation 25 | */ 26 | open var animate: Bool = false { 27 | didSet { 28 | guard animate != oldValue else { return } 29 | if animate { 30 | self.isHidden = false 31 | startAnimation() 32 | } else { 33 | if !displayAfterAnimationEnds { 34 | self.isHidden = true 35 | } 36 | stopAnimation() 37 | } 38 | } 39 | } 40 | 41 | /** 42 | Every function that extends Indeterminate animation must define startAnimation(). 43 | `animate` property of Indeterminate animation will indynamically invoke the subclass method 44 | */ 45 | func startAnimation() { 46 | fatalError("This is an abstract function") 47 | } 48 | 49 | /** 50 | Every function that extends Indeterminate animation must define **stopAnimation()**. 51 | 52 | *animate* property of Indeterminate animation will dynamically invoke the subclass method 53 | */ 54 | func stopAnimation() { 55 | fatalError("This is an abstract function") 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /InDeterminate/MaterialProgress.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MaterialProgress.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 30/06/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | private let duration = 1.5 13 | private let strokeRange = (start: 0.0, end: 0.8) 14 | 15 | @IBDesignable 16 | open class MaterialProgress: IndeterminateAnimation { 17 | 18 | @IBInspectable open var lineWidth: CGFloat = -1 { 19 | didSet { 20 | progressLayer.lineWidth = lineWidth 21 | } 22 | } 23 | 24 | override func notifyViewRedesigned() { 25 | super.notifyViewRedesigned() 26 | progressLayer.strokeColor = foreground.cgColor 27 | } 28 | 29 | var backgroundRotationLayer = CAShapeLayer() 30 | 31 | var progressLayer: CAShapeLayer = { 32 | var tempLayer = CAShapeLayer() 33 | tempLayer.strokeEnd = CGFloat(strokeRange.end) 34 | tempLayer.lineCap = .round 35 | tempLayer.fillColor = NSColor.clear.cgColor 36 | return tempLayer 37 | }() 38 | 39 | //MARK: Animation Declaration 40 | var animationGroup: CAAnimationGroup = { 41 | var tempGroup = CAAnimationGroup() 42 | tempGroup.repeatCount = 1 43 | tempGroup.duration = duration 44 | return tempGroup 45 | }() 46 | 47 | 48 | var rotationAnimation: CABasicAnimation = { 49 | var tempRotation = CABasicAnimation(keyPath: "transform.rotation") 50 | tempRotation.repeatCount = Float.infinity 51 | tempRotation.fromValue = 0 52 | tempRotation.toValue = 1 53 | tempRotation.isCumulative = true 54 | tempRotation.duration = duration / 2 55 | return tempRotation 56 | }() 57 | 58 | /// Makes animation for Stroke Start and Stroke End 59 | func makeStrokeAnimationGroup() { 60 | var strokeStartAnimation: CABasicAnimation! 61 | var strokeEndAnimation: CABasicAnimation! 62 | 63 | func makeAnimationforKeyPath(_ keyPath: String) -> CABasicAnimation { 64 | let tempAnimation = CABasicAnimation(keyPath: keyPath) 65 | tempAnimation.repeatCount = 1 66 | tempAnimation.speed = 2.0 67 | tempAnimation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut) 68 | 69 | tempAnimation.fromValue = strokeRange.start 70 | tempAnimation.toValue = strokeRange.end 71 | tempAnimation.duration = duration 72 | 73 | return tempAnimation 74 | } 75 | strokeEndAnimation = makeAnimationforKeyPath("strokeEnd") 76 | strokeStartAnimation = makeAnimationforKeyPath("strokeStart") 77 | strokeStartAnimation.beginTime = duration / 2 78 | animationGroup.animations = [strokeEndAnimation, strokeStartAnimation, ] 79 | animationGroup.delegate = self 80 | } 81 | 82 | override func configureLayers() { 83 | super.configureLayers() 84 | makeStrokeAnimationGroup() 85 | let rect = self.bounds 86 | 87 | backgroundRotationLayer.frame = rect 88 | self.layer?.addSublayer(backgroundRotationLayer) 89 | 90 | // Progress Layer 91 | let radius = (rect.width / 2) * 0.75 92 | progressLayer.frame = rect 93 | progressLayer.lineWidth = lineWidth == -1 ? radius / 10: lineWidth 94 | let arcPath = NSBezierPath() 95 | arcPath.appendArc(withCenter: rect.mid, radius: radius, startAngle: 0, endAngle: 360, clockwise: false) 96 | progressLayer.path = arcPath.CGPath 97 | backgroundRotationLayer.addSublayer(progressLayer) 98 | } 99 | 100 | var currentRotation = 0.0 101 | let π2 = Double.pi * 2 102 | 103 | override func startAnimation() { 104 | progressLayer.add(animationGroup, forKey: "strokeEnd") 105 | backgroundRotationLayer.add(rotationAnimation, forKey: rotationAnimation.keyPath) 106 | } 107 | override func stopAnimation() { 108 | backgroundRotationLayer.removeAllAnimations() 109 | progressLayer.removeAllAnimations() 110 | } 111 | } 112 | 113 | extension MaterialProgress: CAAnimationDelegate { 114 | open func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 115 | if !animate { return } 116 | CATransaction.begin() 117 | CATransaction.setDisableActions(true) 118 | currentRotation += strokeRange.end * π2 119 | currentRotation = currentRotation.truncatingRemainder(dividingBy: π2) 120 | progressLayer.setAffineTransform(CGAffineTransform(rotationAngle: CGFloat( currentRotation))) 121 | CATransaction.commit() 122 | progressLayer.add(animationGroup, forKey: "strokeEnd") 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /InDeterminate/Rainbow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Rainbow.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 09/07/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | @IBDesignable 13 | open class Rainbow: MaterialProgress { 14 | 15 | @IBInspectable open var onLightOffDark: Bool = false 16 | 17 | override func configureLayers() { 18 | super.configureLayers() 19 | self.background = NSColor.clear 20 | } 21 | 22 | override open func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 23 | super.animationDidStop(anim, finished: flag) 24 | if onLightOffDark { 25 | progressLayer.strokeColor = lightColorList[Int(arc4random()) % lightColorList.count].cgColor 26 | } else { 27 | progressLayer.strokeColor = darkColorList[Int(arc4random()) % darkColorList.count].cgColor 28 | } 29 | } 30 | } 31 | 32 | var randomColor: NSColor { 33 | let red = CGFloat(Double(arc4random()).truncatingRemainder(dividingBy: 256.0) / 256.0) 34 | let green = CGFloat(Double(arc4random()).truncatingRemainder(dividingBy: 256.0) / 256.0) 35 | let blue = CGFloat(Double(arc4random()).truncatingRemainder(dividingBy: 256.0) / 256.0) 36 | return NSColor(calibratedRed: red, green: green, blue: blue, alpha: 1.0) 37 | } 38 | 39 | private let lightColorList:[NSColor] = [ 40 | NSColor(red: 0.9461, green: 0.6699, blue: 0.6243, alpha: 1.0), 41 | NSColor(red: 0.8625, green: 0.7766, blue: 0.8767, alpha: 1.0), 42 | NSColor(red: 0.6676, green: 0.6871, blue: 0.8313, alpha: 1.0), 43 | NSColor(red: 0.7263, green: 0.6189, blue: 0.8379, alpha: 1.0), 44 | NSColor(red: 0.8912, green: 0.9505, blue: 0.9971, alpha: 1.0), 45 | NSColor(red: 0.7697, green: 0.9356, blue: 0.9692, alpha: 1.0), 46 | NSColor(red: 0.3859, green: 0.7533, blue: 0.9477, alpha: 1.0), 47 | NSColor(red: 0.6435, green: 0.8554, blue: 0.8145, alpha: 1.0), 48 | NSColor(red: 0.8002, green: 0.936, blue: 0.7639, alpha: 1.0), 49 | NSColor(red: 0.5362, green: 0.8703, blue: 0.8345, alpha: 1.0), 50 | NSColor(red: 0.9785, green: 0.8055, blue: 0.4049, alpha: 1.0), 51 | NSColor(red: 1.0, green: 0.8667, blue: 0.6453, alpha: 1.0), 52 | NSColor(red: 0.9681, green: 0.677, blue: 0.2837, alpha: 1.0), 53 | NSColor(red: 0.9898, green: 0.7132, blue: 0.1746, alpha: 1.0), 54 | NSColor(red: 0.8238, green: 0.84, blue: 0.8276, alpha: 1.0), 55 | NSColor(red: 0.8532, green: 0.8763, blue: 0.883, alpha: 1.0), 56 | ] 57 | 58 | let darkColorList: [NSColor] = [ 59 | NSColor(red: 0.9472, green: 0.2496, blue: 0.0488, alpha: 1.0), 60 | NSColor(red: 0.8098, green: 0.1695, blue: 0.0467, alpha: 1.0), 61 | NSColor(red: 0.853, green: 0.2302, blue: 0.3607, alpha: 1.0), 62 | NSColor(red: 0.8152, green: 0.3868, blue: 0.5021, alpha: 1.0), 63 | NSColor(red: 0.96, green: 0.277, blue: 0.3515, alpha: 1.0), 64 | NSColor(red: 0.3686, green: 0.3069, blue: 0.6077, alpha: 1.0), 65 | NSColor(red: 0.5529, green: 0.3198, blue: 0.5409, alpha: 1.0), 66 | NSColor(red: 0.2132, green: 0.4714, blue: 0.7104, alpha: 1.0), 67 | NSColor(red: 0.1706, green: 0.2432, blue: 0.3106, alpha: 1.0), 68 | NSColor(red: 0.195, green: 0.2982, blue: 0.3709, alpha: 1.0), 69 | NSColor(red: 0.0, green: 0.3091, blue: 0.5859, alpha: 1.0), 70 | NSColor(red: 0.2261, green: 0.6065, blue: 0.3403, alpha: 1.0), 71 | NSColor(red: 0.1101, green: 0.5694, blue: 0.4522, alpha: 1.0), 72 | NSColor(red: 0.1716, green: 0.4786, blue: 0.2877, alpha: 1.0), 73 | NSColor(red: 0.8289, green: 0.33, blue: 0.0, alpha: 1.0), 74 | NSColor(red: 0.4183, green: 0.4842, blue: 0.5372, alpha: 1.0), 75 | NSColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0), 76 | ] 77 | -------------------------------------------------------------------------------- /InDeterminate/RotatingArc.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RotatingArc.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 26/10/15. 6 | // Copyright © 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | private let duration = 0.25 13 | 14 | @IBDesignable 15 | open class RotatingArc: IndeterminateAnimation { 16 | 17 | var backgroundCircle = CAShapeLayer() 18 | var arcLayer = CAShapeLayer() 19 | 20 | @IBInspectable open var strokeWidth: CGFloat = 5 { 21 | didSet { 22 | notifyViewRedesigned() 23 | } 24 | } 25 | 26 | @IBInspectable open var arcLength: Int = 35 { 27 | didSet { 28 | notifyViewRedesigned() 29 | } 30 | } 31 | 32 | @IBInspectable open var clockWise: Bool = true { 33 | didSet { 34 | notifyViewRedesigned() 35 | } 36 | } 37 | 38 | var radius: CGFloat { 39 | return (self.frame.width / 2) * CGFloat(0.75) 40 | } 41 | 42 | var rotationAnimation: CABasicAnimation = { 43 | var tempRotation = CABasicAnimation(keyPath: "transform.rotation") 44 | tempRotation.repeatCount = .infinity 45 | tempRotation.fromValue = 0 46 | tempRotation.toValue = 1 47 | tempRotation.isCumulative = true 48 | tempRotation.duration = duration 49 | return tempRotation 50 | }() 51 | 52 | override func notifyViewRedesigned() { 53 | super.notifyViewRedesigned() 54 | 55 | arcLayer.strokeColor = foreground.cgColor 56 | backgroundCircle.strokeColor = foreground.withAlphaComponent(0.4).cgColor 57 | 58 | backgroundCircle.lineWidth = self.strokeWidth 59 | arcLayer.lineWidth = strokeWidth 60 | rotationAnimation.toValue = clockWise ? -1 : 1 61 | 62 | let arcPath = NSBezierPath() 63 | let endAngle: CGFloat = CGFloat(-360) * CGFloat(arcLength) / 100 64 | arcPath.appendArc(withCenter: self.bounds.mid, radius: radius, startAngle: 0, endAngle: endAngle, clockwise: true) 65 | 66 | arcLayer.path = arcPath.CGPath 67 | } 68 | 69 | override func configureLayers() { 70 | super.configureLayers() 71 | let rect = self.bounds 72 | 73 | // Add background Circle 74 | do { 75 | backgroundCircle.frame = rect 76 | backgroundCircle.lineWidth = strokeWidth 77 | 78 | backgroundCircle.strokeColor = foreground.withAlphaComponent(0.5).cgColor 79 | backgroundCircle.fillColor = NSColor.clear.cgColor 80 | let backgroundPath = NSBezierPath() 81 | backgroundPath.appendArc(withCenter: rect.mid, radius: radius, startAngle: 0, endAngle: 360) 82 | backgroundCircle.path = backgroundPath.CGPath 83 | self.layer?.addSublayer(backgroundCircle) 84 | } 85 | 86 | // Arc Layer 87 | do { 88 | arcLayer.fillColor = NSColor.clear.cgColor 89 | arcLayer.lineWidth = strokeWidth 90 | 91 | arcLayer.frame = rect 92 | arcLayer.strokeColor = foreground.cgColor 93 | self.layer?.addSublayer(arcLayer) 94 | } 95 | } 96 | 97 | override func startAnimation() { 98 | arcLayer.add(rotationAnimation, forKey: "") 99 | } 100 | 101 | override func stopAnimation() { 102 | arcLayer.removeAllAnimations() 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /InDeterminate/ShootingStars.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ShootingStars.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 09/07/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | @IBDesignable 13 | open class ShootingStars: IndeterminateAnimation { 14 | fileprivate let animationDuration = 1.0 15 | 16 | var starLayer1 = CAShapeLayer() 17 | var starLayer2 = CAShapeLayer() 18 | var animation = CABasicAnimation(keyPath: "position.x") 19 | var tempAnimation = CABasicAnimation(keyPath: "position.x") 20 | 21 | override func notifyViewRedesigned() { 22 | super.notifyViewRedesigned() 23 | starLayer1.backgroundColor = foreground.cgColor 24 | starLayer2.backgroundColor = foreground.cgColor 25 | } 26 | 27 | override func configureLayers() { 28 | super.configureLayers() 29 | 30 | let rect = self.bounds 31 | let dimension = rect.height 32 | let starWidth = dimension * 1.5 33 | 34 | self.layer?.cornerRadius = 0 35 | 36 | /// Add Stars 37 | do { 38 | starLayer1.position = CGPoint(x: dimension / 2, y: dimension / 2) 39 | starLayer1.bounds.size = CGSize(width: starWidth, height: dimension) 40 | starLayer1.backgroundColor = foreground.cgColor 41 | self.layer?.addSublayer(starLayer1) 42 | 43 | starLayer2.position = CGPoint(x: rect.midX, y: dimension / 2) 44 | starLayer2.bounds.size = CGSize(width: starWidth, height: dimension) 45 | starLayer2.backgroundColor = foreground.cgColor 46 | self.layer?.addSublayer(starLayer2) 47 | } 48 | 49 | /// Add default animation 50 | do { 51 | animation.fromValue = -dimension 52 | animation.toValue = rect.width * 0.9 53 | animation.duration = animationDuration 54 | animation.timingFunction = CAMediaTimingFunction(name: .easeIn) 55 | animation.isRemovedOnCompletion = false 56 | animation.repeatCount = .infinity 57 | } 58 | 59 | /** Temp animation will be removed after first animation 60 | After finishing it will invoke animationDidStop and starLayer2 is also given default animation. 61 | The purpose of temp animation is to generate an temporary offset 62 | */ 63 | tempAnimation.fromValue = rect.midX 64 | tempAnimation.toValue = rect.width 65 | tempAnimation.delegate = self 66 | tempAnimation.duration = animationDuration / 2 67 | tempAnimation.timingFunction = CAMediaTimingFunction(name: .easeIn) 68 | } 69 | 70 | //MARK: Indeterminable protocol 71 | override func startAnimation() { 72 | starLayer1.add(animation, forKey: "default") 73 | starLayer2.add(tempAnimation, forKey: "tempAnimation") 74 | } 75 | 76 | override func stopAnimation() { 77 | starLayer1.removeAllAnimations() 78 | starLayer2.removeAllAnimations() 79 | } 80 | } 81 | 82 | extension ShootingStars: CAAnimationDelegate { 83 | open func animationDidStop(_ anim: CAAnimation, finished flag: Bool) { 84 | starLayer2.add(animation, forKey: "default") 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /InDeterminate/Spinner.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Spinner.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 28/07/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | @IBDesignable 13 | open class Spinner: IndeterminateAnimation { 14 | 15 | var basicShape = CAShapeLayer() 16 | var containerLayer = CAShapeLayer() 17 | var starList = [CAShapeLayer]() 18 | 19 | var animation: CAKeyframeAnimation = { 20 | var animation = CAKeyframeAnimation(keyPath: "transform.rotation") 21 | animation.repeatCount = .infinity 22 | animation.calculationMode = .discrete 23 | return animation 24 | }() 25 | 26 | @IBInspectable open var starSize:CGSize = CGSize(width: 6, height: 15) { 27 | didSet { 28 | notifyViewRedesigned() 29 | } 30 | } 31 | 32 | @IBInspectable open var roundedCorners: Bool = true { 33 | didSet { 34 | notifyViewRedesigned() 35 | } 36 | } 37 | 38 | 39 | @IBInspectable open var distance: CGFloat = CGFloat(20) { 40 | didSet { 41 | notifyViewRedesigned() 42 | } 43 | } 44 | 45 | @IBInspectable open var starCount: Int = 10 { 46 | didSet { 47 | notifyViewRedesigned() 48 | } 49 | } 50 | 51 | @IBInspectable open var duration: Double = 1 { 52 | didSet { 53 | animation.duration = duration 54 | } 55 | } 56 | 57 | @IBInspectable open var clockwise: Bool = false { 58 | didSet { 59 | notifyViewRedesigned() 60 | } 61 | } 62 | 63 | override func configureLayers() { 64 | super.configureLayers() 65 | 66 | containerLayer.frame = self.bounds 67 | containerLayer.cornerRadius = frame.width / 2 68 | self.layer?.addSublayer(containerLayer) 69 | 70 | animation.duration = duration 71 | } 72 | 73 | override func notifyViewRedesigned() { 74 | super.notifyViewRedesigned() 75 | starList.removeAll(keepingCapacity: true) 76 | containerLayer.sublayers = nil 77 | animation.values = [Double]() 78 | var i = 0.0 79 | while i < 360 { 80 | var iRadian = CGFloat(i * Double.pi / 180.0) 81 | if clockwise { iRadian = -iRadian } 82 | 83 | animation.values?.append(iRadian) 84 | let starShape = CAShapeLayer() 85 | starShape.cornerRadius = roundedCorners ? starSize.width / 2 : 0 86 | 87 | let centerLocation = CGPoint(x: frame.width / 2 - starSize.width / 2, y: frame.width / 2 - starSize.height / 2) 88 | 89 | starShape.frame = CGRect(origin: centerLocation, size: starSize) 90 | 91 | starShape.backgroundColor = foreground.cgColor 92 | starShape.anchorPoint = CGPoint(x: 0.5, y: 0) 93 | 94 | var rotation: CATransform3D = CATransform3DMakeTranslation(0, 0, 0.0); 95 | 96 | rotation = CATransform3DRotate(rotation, -iRadian, 0.0, 0.0, 1.0); 97 | rotation = CATransform3DTranslate(rotation, 0, distance, 0.0); 98 | starShape.transform = rotation 99 | 100 | starShape.opacity = Float(360 - i) / 360 101 | containerLayer.addSublayer(starShape) 102 | starList.append(starShape) 103 | i = i + Double(360 / starCount) 104 | } 105 | } 106 | 107 | override func startAnimation() { 108 | containerLayer.add(animation, forKey: "rotation") 109 | } 110 | 111 | override func stopAnimation() { 112 | containerLayer.removeAllAnimations() 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Kaunteya Suryawanshi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ProgressKit.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = 'ProgressKit' 3 | spec.version = '0.8' 4 | spec.license = 'MIT' 5 | spec.summary = 'Animated ProgressViews for macOS' 6 | spec.homepage = 'https://github.com/kaunteya/ProgressKit' 7 | spec.authors = { 'Kaunteya Suryawanshi' => 'k.suryawanshi@gmail.com' } 8 | spec.source = { :git => 'https://github.com/kaunteya/ProgressKit.git', :tag => spec.version } 9 | 10 | spec.platform = :osx, '10.10' 11 | spec.requires_arc = true 12 | 13 | spec.source_files = 'Determinate/*.swift', 'InDeterminate/*.swift', 'ProgressUtils.swift', 'BaseView.swift' 14 | end 15 | -------------------------------------------------------------------------------- /ProgressKit.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E31617A61BC0596C007AD70F /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E31617A51BC0596C007AD70F /* BaseView.swift */; }; 11 | E340FDB81BDE45F000CE6550 /* RotatingArc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E340FDB71BDE45F000CE6550 /* RotatingArc.swift */; }; 12 | E35D1C6C1B676889001DBAF2 /* Spinner.swift in Sources */ = {isa = PBXBuildFile; fileRef = E35D1C6B1B676889001DBAF2 /* Spinner.swift */; }; 13 | E37568DF1B6AAB530073E26F /* ProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = E37568DE1B6AAB530073E26F /* ProgressBar.swift */; }; 14 | E3918F811B4E88CF00558DAB /* CircularProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F801B4E88CF00558DAB /* CircularProgressView.swift */; }; 15 | E3918F841B4E88DE00558DAB /* MaterialProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F821B4E88DE00558DAB /* MaterialProgress.swift */; }; 16 | E3918F851B4E88DE00558DAB /* ShootingStars.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F831B4E88DE00558DAB /* ShootingStars.swift */; }; 17 | E3918F8D1B4E8AB100558DAB /* IndeterminateAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F8C1B4E8AB100558DAB /* IndeterminateAnimation.swift */; }; 18 | E3918F8F1B4E8C2900558DAB /* DeterminateAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F8E1B4E8C2900558DAB /* DeterminateAnimation.swift */; }; 19 | E3918FA81B4ECF7100558DAB /* Rainbow.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918FA71B4ECF7100558DAB /* Rainbow.swift */; }; 20 | E3A468521B5434F7006DDE31 /* Crawler.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3A468511B5434F7006DDE31 /* Crawler.swift */; }; 21 | E3AD65D81B426758009541CD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3AD65D71B426758009541CD /* AppDelegate.swift */; }; 22 | E3AD65DA1B426758009541CD /* DeterminateVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3AD65D91B426758009541CD /* DeterminateVC.swift */; }; 23 | E3AD65DF1B426758009541CD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E3AD65DD1B426758009541CD /* Main.storyboard */; }; 24 | E3AD65EB1B426758009541CD /* ProgressKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3AD65EA1B426758009541CD /* ProgressKitTests.swift */; }; 25 | E3AD65F71B427511009541CD /* InDeterminateVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3AD65F61B427511009541CD /* InDeterminateVC.swift */; }; 26 | E3CCD59A1BBC2B9B00F7DB9A /* ProgressUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3CCD5991BBC2B9B00F7DB9A /* ProgressUtils.swift */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | E3AD65E51B426758009541CD /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = E3AD65CA1B426758009541CD /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = E3AD65D11B426758009541CD; 35 | remoteInfo = ProgressKit; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | E310B1D21D7AB2D4008DEF62 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; }; 41 | E310B1D41D7AB2EA008DEF62 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; }; 42 | E31617A51BC0596C007AD70F /* BaseView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseView.swift; sourceTree = ""; }; 43 | E340FDB71BDE45F000CE6550 /* RotatingArc.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RotatingArc.swift; path = InDeterminate/RotatingArc.swift; sourceTree = ""; }; 44 | E35D1C6B1B676889001DBAF2 /* Spinner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Spinner.swift; path = InDeterminate/Spinner.swift; sourceTree = ""; }; 45 | E37568DE1B6AAB530073E26F /* ProgressBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProgressBar.swift; path = Determinate/ProgressBar.swift; sourceTree = ""; }; 46 | E3918F801B4E88CF00558DAB /* CircularProgressView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CircularProgressView.swift; path = Determinate/CircularProgressView.swift; sourceTree = ""; }; 47 | E3918F821B4E88DE00558DAB /* MaterialProgress.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MaterialProgress.swift; path = InDeterminate/MaterialProgress.swift; sourceTree = ""; }; 48 | E3918F831B4E88DE00558DAB /* ShootingStars.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ShootingStars.swift; path = InDeterminate/ShootingStars.swift; sourceTree = ""; }; 49 | E3918F8C1B4E8AB100558DAB /* IndeterminateAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IndeterminateAnimation.swift; path = InDeterminate/IndeterminateAnimation.swift; sourceTree = ""; }; 50 | E3918F8E1B4E8C2900558DAB /* DeterminateAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DeterminateAnimation.swift; path = Determinate/DeterminateAnimation.swift; sourceTree = ""; }; 51 | E3918FA71B4ECF7100558DAB /* Rainbow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Rainbow.swift; path = InDeterminate/Rainbow.swift; sourceTree = ""; }; 52 | E3A468511B5434F7006DDE31 /* Crawler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Crawler.swift; path = InDeterminate/Crawler.swift; sourceTree = ""; }; 53 | E3AD65D21B426758009541CD /* ProgressKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ProgressKit.app; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | E3AD65D61B426758009541CD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | E3AD65D71B426758009541CD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 56 | E3AD65D91B426758009541CD /* DeterminateVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeterminateVC.swift; sourceTree = ""; }; 57 | E3AD65DE1B426758009541CD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | E3AD65E41B426758009541CD /* ProgressKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ProgressKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | E3AD65E91B426758009541CD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | E3AD65EA1B426758009541CD /* ProgressKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressKitTests.swift; sourceTree = ""; }; 61 | E3AD65F61B427511009541CD /* InDeterminateVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InDeterminateVC.swift; sourceTree = ""; }; 62 | E3CCD5971BBC19ED00F7DB9A /* ProgressKit.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ProgressKit.podspec; sourceTree = SOURCE_ROOT; }; 63 | E3CCD5991BBC2B9B00F7DB9A /* ProgressUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgressUtils.swift; sourceTree = SOURCE_ROOT; }; 64 | /* End PBXFileReference section */ 65 | 66 | /* Begin PBXFrameworksBuildPhase section */ 67 | E3AD65CF1B426758009541CD /* Frameworks */ = { 68 | isa = PBXFrameworksBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | ); 72 | runOnlyForDeploymentPostprocessing = 0; 73 | }; 74 | E3AD65E11B426758009541CD /* Frameworks */ = { 75 | isa = PBXFrameworksBuildPhase; 76 | buildActionMask = 2147483647; 77 | files = ( 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | E316CCAA1B4E8633005A9A31 /* Indeterminate */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | E3918F8C1B4E8AB100558DAB /* IndeterminateAnimation.swift */, 88 | E3918F821B4E88DE00558DAB /* MaterialProgress.swift */, 89 | E3918FA71B4ECF7100558DAB /* Rainbow.swift */, 90 | E3A468511B5434F7006DDE31 /* Crawler.swift */, 91 | E3918F831B4E88DE00558DAB /* ShootingStars.swift */, 92 | E35D1C6B1B676889001DBAF2 /* Spinner.swift */, 93 | E340FDB71BDE45F000CE6550 /* RotatingArc.swift */, 94 | ); 95 | name = Indeterminate; 96 | sourceTree = ""; 97 | }; 98 | E316CCAB1B4E8642005A9A31 /* Determinate */ = { 99 | isa = PBXGroup; 100 | children = ( 101 | E3918F8E1B4E8C2900558DAB /* DeterminateAnimation.swift */, 102 | E3918F801B4E88CF00558DAB /* CircularProgressView.swift */, 103 | E37568DE1B6AAB530073E26F /* ProgressBar.swift */, 104 | ); 105 | name = Determinate; 106 | sourceTree = ""; 107 | }; 108 | E3AD65C91B426758009541CD = { 109 | isa = PBXGroup; 110 | children = ( 111 | E31617A51BC0596C007AD70F /* BaseView.swift */, 112 | E316CCAA1B4E8633005A9A31 /* Indeterminate */, 113 | E316CCAB1B4E8642005A9A31 /* Determinate */, 114 | E3AD65D41B426758009541CD /* ProgressKit */, 115 | E3AD65E71B426758009541CD /* ProgressKitTests */, 116 | E3AD65D31B426758009541CD /* Products */, 117 | ); 118 | sourceTree = ""; 119 | }; 120 | E3AD65D31B426758009541CD /* Products */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | E3AD65D21B426758009541CD /* ProgressKit.app */, 124 | E3AD65E41B426758009541CD /* ProgressKitTests.xctest */, 125 | ); 126 | name = Products; 127 | sourceTree = ""; 128 | }; 129 | E3AD65D41B426758009541CD /* ProgressKit */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | E3AD65D71B426758009541CD /* AppDelegate.swift */, 133 | E3AD65D91B426758009541CD /* DeterminateVC.swift */, 134 | E3AD65F61B427511009541CD /* InDeterminateVC.swift */, 135 | E3AD65DD1B426758009541CD /* Main.storyboard */, 136 | E3AD65D51B426758009541CD /* Supporting Files */, 137 | ); 138 | path = ProgressKit; 139 | sourceTree = ""; 140 | }; 141 | E3AD65D51B426758009541CD /* Supporting Files */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | E310B1D21D7AB2D4008DEF62 /* README.md */, 145 | E310B1D41D7AB2EA008DEF62 /* LICENSE */, 146 | E3CCD5991BBC2B9B00F7DB9A /* ProgressUtils.swift */, 147 | E3CCD5971BBC19ED00F7DB9A /* ProgressKit.podspec */, 148 | E3AD65D61B426758009541CD /* Info.plist */, 149 | ); 150 | name = "Supporting Files"; 151 | sourceTree = ""; 152 | }; 153 | E3AD65E71B426758009541CD /* ProgressKitTests */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | E3AD65EA1B426758009541CD /* ProgressKitTests.swift */, 157 | E3AD65E81B426758009541CD /* Supporting Files */, 158 | ); 159 | path = ProgressKitTests; 160 | sourceTree = ""; 161 | }; 162 | E3AD65E81B426758009541CD /* Supporting Files */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | E3AD65E91B426758009541CD /* Info.plist */, 166 | ); 167 | name = "Supporting Files"; 168 | sourceTree = ""; 169 | }; 170 | /* End PBXGroup section */ 171 | 172 | /* Begin PBXNativeTarget section */ 173 | E3AD65D11B426758009541CD /* ProgressKit */ = { 174 | isa = PBXNativeTarget; 175 | buildConfigurationList = E3AD65EE1B426758009541CD /* Build configuration list for PBXNativeTarget "ProgressKit" */; 176 | buildPhases = ( 177 | E3AD65CE1B426758009541CD /* Sources */, 178 | E3AD65CF1B426758009541CD /* Frameworks */, 179 | E3AD65D01B426758009541CD /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | ); 185 | name = ProgressKit; 186 | productName = ProgressKit; 187 | productReference = E3AD65D21B426758009541CD /* ProgressKit.app */; 188 | productType = "com.apple.product-type.application"; 189 | }; 190 | E3AD65E31B426758009541CD /* ProgressKitTests */ = { 191 | isa = PBXNativeTarget; 192 | buildConfigurationList = E3AD65F11B426758009541CD /* Build configuration list for PBXNativeTarget "ProgressKitTests" */; 193 | buildPhases = ( 194 | E3AD65E01B426758009541CD /* Sources */, 195 | E3AD65E11B426758009541CD /* Frameworks */, 196 | E3AD65E21B426758009541CD /* Resources */, 197 | ); 198 | buildRules = ( 199 | ); 200 | dependencies = ( 201 | E3AD65E61B426758009541CD /* PBXTargetDependency */, 202 | ); 203 | name = ProgressKitTests; 204 | productName = ProgressKitTests; 205 | productReference = E3AD65E41B426758009541CD /* ProgressKitTests.xctest */; 206 | productType = "com.apple.product-type.bundle.unit-test"; 207 | }; 208 | /* End PBXNativeTarget section */ 209 | 210 | /* Begin PBXProject section */ 211 | E3AD65CA1B426758009541CD /* Project object */ = { 212 | isa = PBXProject; 213 | attributes = { 214 | LastSwiftMigration = 0700; 215 | LastSwiftUpdateCheck = 0700; 216 | LastUpgradeCheck = 1000; 217 | ORGANIZATIONNAME = "Kauntey Suryawanshi"; 218 | TargetAttributes = { 219 | E3AD65D11B426758009541CD = { 220 | CreatedOnToolsVersion = 6.3.2; 221 | LastSwiftMigration = 0920; 222 | }; 223 | E3AD65E31B426758009541CD = { 224 | CreatedOnToolsVersion = 6.3.2; 225 | LastSwiftMigration = 0920; 226 | TestTargetID = E3AD65D11B426758009541CD; 227 | }; 228 | }; 229 | }; 230 | buildConfigurationList = E3AD65CD1B426758009541CD /* Build configuration list for PBXProject "ProgressKit" */; 231 | compatibilityVersion = "Xcode 3.2"; 232 | developmentRegion = English; 233 | hasScannedForEncodings = 0; 234 | knownRegions = ( 235 | en, 236 | Base, 237 | ); 238 | mainGroup = E3AD65C91B426758009541CD; 239 | productRefGroup = E3AD65D31B426758009541CD /* Products */; 240 | projectDirPath = ""; 241 | projectRoot = ""; 242 | targets = ( 243 | E3AD65D11B426758009541CD /* ProgressKit */, 244 | E3AD65E31B426758009541CD /* ProgressKitTests */, 245 | ); 246 | }; 247 | /* End PBXProject section */ 248 | 249 | /* Begin PBXResourcesBuildPhase section */ 250 | E3AD65D01B426758009541CD /* Resources */ = { 251 | isa = PBXResourcesBuildPhase; 252 | buildActionMask = 2147483647; 253 | files = ( 254 | E3AD65DF1B426758009541CD /* Main.storyboard in Resources */, 255 | ); 256 | runOnlyForDeploymentPostprocessing = 0; 257 | }; 258 | E3AD65E21B426758009541CD /* Resources */ = { 259 | isa = PBXResourcesBuildPhase; 260 | buildActionMask = 2147483647; 261 | files = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | }; 265 | /* End PBXResourcesBuildPhase section */ 266 | 267 | /* Begin PBXSourcesBuildPhase section */ 268 | E3AD65CE1B426758009541CD /* Sources */ = { 269 | isa = PBXSourcesBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | E3A468521B5434F7006DDE31 /* Crawler.swift in Sources */, 273 | E3AD65DA1B426758009541CD /* DeterminateVC.swift in Sources */, 274 | E3918F8D1B4E8AB100558DAB /* IndeterminateAnimation.swift in Sources */, 275 | E3AD65F71B427511009541CD /* InDeterminateVC.swift in Sources */, 276 | E3918F851B4E88DE00558DAB /* ShootingStars.swift in Sources */, 277 | E3918F811B4E88CF00558DAB /* CircularProgressView.swift in Sources */, 278 | E35D1C6C1B676889001DBAF2 /* Spinner.swift in Sources */, 279 | E3918F841B4E88DE00558DAB /* MaterialProgress.swift in Sources */, 280 | E3AD65D81B426758009541CD /* AppDelegate.swift in Sources */, 281 | E37568DF1B6AAB530073E26F /* ProgressBar.swift in Sources */, 282 | E340FDB81BDE45F000CE6550 /* RotatingArc.swift in Sources */, 283 | E3CCD59A1BBC2B9B00F7DB9A /* ProgressUtils.swift in Sources */, 284 | E31617A61BC0596C007AD70F /* BaseView.swift in Sources */, 285 | E3918FA81B4ECF7100558DAB /* Rainbow.swift in Sources */, 286 | E3918F8F1B4E8C2900558DAB /* DeterminateAnimation.swift in Sources */, 287 | ); 288 | runOnlyForDeploymentPostprocessing = 0; 289 | }; 290 | E3AD65E01B426758009541CD /* Sources */ = { 291 | isa = PBXSourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | E3AD65EB1B426758009541CD /* ProgressKitTests.swift in Sources */, 295 | ); 296 | runOnlyForDeploymentPostprocessing = 0; 297 | }; 298 | /* End PBXSourcesBuildPhase section */ 299 | 300 | /* Begin PBXTargetDependency section */ 301 | E3AD65E61B426758009541CD /* PBXTargetDependency */ = { 302 | isa = PBXTargetDependency; 303 | target = E3AD65D11B426758009541CD /* ProgressKit */; 304 | targetProxy = E3AD65E51B426758009541CD /* PBXContainerItemProxy */; 305 | }; 306 | /* End PBXTargetDependency section */ 307 | 308 | /* Begin PBXVariantGroup section */ 309 | E3AD65DD1B426758009541CD /* Main.storyboard */ = { 310 | isa = PBXVariantGroup; 311 | children = ( 312 | E3AD65DE1B426758009541CD /* Base */, 313 | ); 314 | name = Main.storyboard; 315 | sourceTree = ""; 316 | }; 317 | /* End PBXVariantGroup section */ 318 | 319 | /* Begin XCBuildConfiguration section */ 320 | E3AD65EC1B426758009541CD /* Debug */ = { 321 | isa = XCBuildConfiguration; 322 | buildSettings = { 323 | ALWAYS_SEARCH_USER_PATHS = NO; 324 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 325 | CLANG_CXX_LIBRARY = "libc++"; 326 | CLANG_ENABLE_MODULES = YES; 327 | CLANG_ENABLE_OBJC_ARC = YES; 328 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 329 | CLANG_WARN_BOOL_CONVERSION = YES; 330 | CLANG_WARN_COMMA = YES; 331 | CLANG_WARN_CONSTANT_CONVERSION = YES; 332 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 333 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 334 | CLANG_WARN_EMPTY_BODY = YES; 335 | CLANG_WARN_ENUM_CONVERSION = YES; 336 | CLANG_WARN_INFINITE_RECURSION = YES; 337 | CLANG_WARN_INT_CONVERSION = YES; 338 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 339 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 340 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 341 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 342 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 343 | CLANG_WARN_STRICT_PROTOTYPES = YES; 344 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 345 | CLANG_WARN_UNREACHABLE_CODE = YES; 346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 347 | CODE_SIGN_IDENTITY = "-"; 348 | COPY_PHASE_STRIP = NO; 349 | DEBUG_INFORMATION_FORMAT = dwarf; 350 | ENABLE_STRICT_OBJC_MSGSEND = YES; 351 | ENABLE_TESTABILITY = YES; 352 | GCC_C_LANGUAGE_STANDARD = gnu99; 353 | GCC_DYNAMIC_NO_PIC = NO; 354 | GCC_NO_COMMON_BLOCKS = YES; 355 | GCC_OPTIMIZATION_LEVEL = 0; 356 | GCC_PREPROCESSOR_DEFINITIONS = ( 357 | "DEBUG=1", 358 | "$(inherited)", 359 | ); 360 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 361 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 363 | GCC_WARN_UNDECLARED_SELECTOR = YES; 364 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 365 | GCC_WARN_UNUSED_FUNCTION = YES; 366 | GCC_WARN_UNUSED_VARIABLE = YES; 367 | MACOSX_DEPLOYMENT_TARGET = 10.10; 368 | MTL_ENABLE_DEBUG_INFO = YES; 369 | ONLY_ACTIVE_ARCH = YES; 370 | SDKROOT = macosx; 371 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 372 | }; 373 | name = Debug; 374 | }; 375 | E3AD65ED1B426758009541CD /* Release */ = { 376 | isa = XCBuildConfiguration; 377 | buildSettings = { 378 | ALWAYS_SEARCH_USER_PATHS = NO; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_COMMA = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_EMPTY_BODY = YES; 390 | CLANG_WARN_ENUM_CONVERSION = YES; 391 | CLANG_WARN_INFINITE_RECURSION = YES; 392 | CLANG_WARN_INT_CONVERSION = YES; 393 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 395 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 396 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 397 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 398 | CLANG_WARN_STRICT_PROTOTYPES = YES; 399 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 400 | CLANG_WARN_UNREACHABLE_CODE = YES; 401 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 402 | CODE_SIGN_IDENTITY = "-"; 403 | COPY_PHASE_STRIP = NO; 404 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 405 | ENABLE_NS_ASSERTIONS = NO; 406 | ENABLE_STRICT_OBJC_MSGSEND = YES; 407 | GCC_C_LANGUAGE_STANDARD = gnu99; 408 | GCC_NO_COMMON_BLOCKS = YES; 409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 411 | GCC_WARN_UNDECLARED_SELECTOR = YES; 412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 413 | GCC_WARN_UNUSED_FUNCTION = YES; 414 | GCC_WARN_UNUSED_VARIABLE = YES; 415 | MACOSX_DEPLOYMENT_TARGET = 10.10; 416 | MTL_ENABLE_DEBUG_INFO = NO; 417 | SDKROOT = macosx; 418 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 419 | }; 420 | name = Release; 421 | }; 422 | E3AD65EF1B426758009541CD /* Debug */ = { 423 | isa = XCBuildConfiguration; 424 | buildSettings = { 425 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 426 | COMBINE_HIDPI_IMAGES = YES; 427 | INFOPLIST_FILE = ProgressKit/Info.plist; 428 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 429 | PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)"; 430 | PRODUCT_NAME = "$(TARGET_NAME)"; 431 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 432 | SWIFT_VERSION = 4.2; 433 | }; 434 | name = Debug; 435 | }; 436 | E3AD65F01B426758009541CD /* Release */ = { 437 | isa = XCBuildConfiguration; 438 | buildSettings = { 439 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 440 | COMBINE_HIDPI_IMAGES = YES; 441 | INFOPLIST_FILE = ProgressKit/Info.plist; 442 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 443 | PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)"; 444 | PRODUCT_NAME = "$(TARGET_NAME)"; 445 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 446 | SWIFT_VERSION = 4.2; 447 | }; 448 | name = Release; 449 | }; 450 | E3AD65F21B426758009541CD /* Debug */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | BUNDLE_LOADER = "$(TEST_HOST)"; 454 | COMBINE_HIDPI_IMAGES = YES; 455 | FRAMEWORK_SEARCH_PATHS = ( 456 | "$(DEVELOPER_FRAMEWORKS_DIR)", 457 | "$(inherited)", 458 | ); 459 | GCC_PREPROCESSOR_DEFINITIONS = ( 460 | "DEBUG=1", 461 | "$(inherited)", 462 | ); 463 | INFOPLIST_FILE = ProgressKitTests/Info.plist; 464 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 465 | PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)"; 466 | PRODUCT_NAME = "$(TARGET_NAME)"; 467 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 468 | SWIFT_VERSION = 4.0; 469 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit"; 470 | }; 471 | name = Debug; 472 | }; 473 | E3AD65F31B426758009541CD /* Release */ = { 474 | isa = XCBuildConfiguration; 475 | buildSettings = { 476 | BUNDLE_LOADER = "$(TEST_HOST)"; 477 | COMBINE_HIDPI_IMAGES = YES; 478 | FRAMEWORK_SEARCH_PATHS = ( 479 | "$(DEVELOPER_FRAMEWORKS_DIR)", 480 | "$(inherited)", 481 | ); 482 | INFOPLIST_FILE = ProgressKitTests/Info.plist; 483 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 484 | PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)"; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 487 | SWIFT_VERSION = 4.0; 488 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit"; 489 | }; 490 | name = Release; 491 | }; 492 | /* End XCBuildConfiguration section */ 493 | 494 | /* Begin XCConfigurationList section */ 495 | E3AD65CD1B426758009541CD /* Build configuration list for PBXProject "ProgressKit" */ = { 496 | isa = XCConfigurationList; 497 | buildConfigurations = ( 498 | E3AD65EC1B426758009541CD /* Debug */, 499 | E3AD65ED1B426758009541CD /* Release */, 500 | ); 501 | defaultConfigurationIsVisible = 0; 502 | defaultConfigurationName = Release; 503 | }; 504 | E3AD65EE1B426758009541CD /* Build configuration list for PBXNativeTarget "ProgressKit" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | E3AD65EF1B426758009541CD /* Debug */, 508 | E3AD65F01B426758009541CD /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | E3AD65F11B426758009541CD /* Build configuration list for PBXNativeTarget "ProgressKitTests" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | E3AD65F21B426758009541CD /* Debug */, 517 | E3AD65F31B426758009541CD /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | /* End XCConfigurationList section */ 523 | }; 524 | rootObject = E3AD65CA1B426758009541CD /* Project object */; 525 | } 526 | -------------------------------------------------------------------------------- /ProgressKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ProgressKit/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 30/06/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | func applicationDidFinishLaunching(_ aNotification: Notification) { 15 | // Insert code here to initialize your application 16 | } 17 | 18 | func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 19 | return true 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /ProgressKit/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | Default 510 | 511 | 512 | 513 | 514 | 515 | 516 | Left to Right 517 | 518 | 519 | 520 | 521 | 522 | 523 | Right to Left 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | Default 535 | 536 | 537 | 538 | 539 | 540 | 541 | Left to Right 542 | 543 | 544 | 545 | 546 | 547 | 548 | Right to Left 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 784 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 1161 | 1162 | 1163 | 1164 | 1165 | 1166 | 1167 | 1168 | 1169 | 1170 | 1171 | 1172 | 1173 | 1174 | 1175 | 1176 | 1177 | 1178 | 1179 | 1180 | 1181 | 1182 | 1183 | 1184 | 1185 | 1186 | 1187 | 1188 | 1189 | 1190 | 1191 | 1192 | 1193 | 1194 | 1195 | 1196 | 1197 | 1198 | 1199 | 1200 | 1201 | 1202 | 1203 | 1204 | 1205 | 1206 | 1207 | 1208 | 1209 | 1210 | 1211 | 1212 | 1213 | 1214 | 1215 | 1216 | 1217 | 1218 | 1219 | 1220 | 1221 | 1222 | 1223 | 1224 | 1225 | 1226 | 1227 | 1228 | 1229 | 1230 | 1231 | 1232 | 1233 | 1234 | 1235 | 1236 | 1237 | 1238 | 1239 | 1240 | 1241 | 1242 | 1243 | 1244 | 1245 | 1246 | 1247 | 1248 | 1249 | 1250 | 1251 | 1252 | 1253 | 1254 | 1255 | 1256 | 1257 | 1258 | 1259 | 1260 | 1261 | 1262 | 1263 | 1264 | 1265 | 1266 | 1267 | 1268 | 1269 | 1270 | 1271 | 1272 | 1273 | 1274 | 1275 | 1276 | 1277 | 1278 | 1279 | 1280 | 1281 | 1282 | 1283 | 1284 | 1285 | 1286 | 1287 | 1288 | 1289 | 1290 | 1291 | 1292 | 1293 | 1294 | 1295 | 1296 | 1297 | 1298 | 1299 | 1300 | 1301 | 1302 | 1303 | 1304 | 1305 | 1306 | 1307 | 1308 | 1309 | 1310 | 1311 | 1312 | 1313 | 1314 | 1315 | 1316 | 1317 | 1318 | 1319 | 1320 | 1321 | 1322 | 1323 | 1324 | 1325 | 1326 | 1327 | 1328 | 1329 | 1330 | 1331 | 1332 | 1333 | 1334 | 1335 | 1336 | 1337 | 1338 | 1339 | 1340 | 1341 | 1342 | 1343 | 1344 | 1345 | 1346 | 1347 | 1348 | 1349 | 1350 | 1351 | 1352 | 1353 | 1354 | 1355 | 1356 | 1357 | 1358 | 1359 | 1360 | 1361 | 1362 | 1363 | 1364 | 1365 | 1366 | 1367 | 1368 | 1369 | 1370 | 1371 | 1372 | 1373 | 1374 | 1375 | 1376 | 1377 | 1378 | 1379 | 1380 | 1381 | 1382 | 1383 | 1384 | 1385 | 1386 | 1387 | 1388 | 1389 | 1390 | 1391 | 1392 | 1393 | 1394 | 1395 | 1396 | 1397 | 1398 | 1399 | 1400 | 1401 | 1402 | 1403 | 1404 | 1405 | 1406 | 1407 | 1408 | 1409 | 1410 | 1411 | 1412 | 1413 | 1414 | 1415 | 1416 | 1417 | 1418 | 1419 | 1420 | 1421 | 1422 | 1423 | 1424 | 1425 | 1426 | 1427 | 1428 | 1429 | 1430 | 1431 | 1432 | 1433 | 1434 | 1435 | 1436 | 1437 | 1438 | 1439 | 1440 | 1441 | 1442 | 1443 | 1444 | 1445 | 1446 | 1447 | 1448 | 1449 | 1450 | 1451 | 1452 | 1453 | 1454 | 1455 | 1456 | 1457 | 1458 | 1459 | 1460 | 1461 | 1462 | 1463 | 1464 | 1465 | 1466 | 1467 | 1468 | 1469 | 1470 | 1471 | 1472 | 1473 | 1474 | 1475 | 1476 | 1477 | 1478 | 1479 | 1480 | 1481 | 1482 | 1483 | 1484 | 1485 | 1486 | 1487 | 1488 | 1489 | 1490 | 1491 | 1492 | 1493 | 1494 | -------------------------------------------------------------------------------- /ProgressKit/Determinate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 30/06/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class DeterminateViewController: NSViewController { 12 | 13 | dynamic var liveProgress: Bool = true 14 | dynamic var labelPercentage: String = "30%" 15 | 16 | @IBOutlet weak var circularView1: CircularProgressView! 17 | @IBOutlet weak var circularView2: CircularProgressView! 18 | @IBOutlet weak var circularView3: CircularProgressView! 19 | @IBOutlet weak var circularView4: CircularProgressView! 20 | @IBOutlet weak var circularView5: CircularProgressView! 21 | @IBOutlet weak var slider: NSSlider! 22 | 23 | @IBAction func sliderDragged(sender: NSSlider) { 24 | 25 | let event = NSApplication.sharedApplication().currentEvent 26 | let dragStart = event!.type == NSEventType.LeftMouseDown 27 | let dragEnd = event!.type == NSEventType.LeftMouseUp 28 | let dragging = event!.type == NSEventType.LeftMouseDragged 29 | 30 | if liveProgress || dragEnd { 31 | setProgress(CGFloat(sender.floatValue)) 32 | } 33 | labelPercentage = "\(Int(sender.floatValue * 100))%" 34 | } 35 | 36 | func setProgress(progress: CGFloat) { 37 | circularView1.setProgressValue(progress, animated: true) 38 | circularView2.setProgressValue(progress, animated: true) 39 | circularView3.setProgressValue(progress, animated: true) 40 | circularView4.setProgressValue(progress, animated: true) 41 | circularView5.setProgressValue(progress, animated: false) 42 | } 43 | 44 | override func viewDidLoad() { 45 | preferredContentSize = NSMakeSize(500, 500) 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /ProgressKit/DeterminateVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 30/06/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class DeterminateViewController: NSViewController { 12 | 13 | @objc dynamic var liveProgress: Bool = true 14 | @objc dynamic var labelPercentage: String = "30%" 15 | 16 | override func viewDidLoad() { 17 | preferredContentSize = NSMakeSize(500, 300) 18 | } 19 | 20 | @IBOutlet weak var slider: NSSlider! 21 | 22 | @IBAction func sliderDragged(_ sender: NSSlider) { 23 | 24 | let event = NSApplication.shared.currentEvent 25 | // let dragStart = event!.type == NSEventType.LeftMouseDown 26 | let dragEnd = event!.type == NSEvent.EventType.leftMouseUp 27 | // let dragging = event!.type == NSEventType.LeftMouseDragged 28 | 29 | if liveProgress || dragEnd { 30 | setProgress(CGFloat(sender.floatValue)) 31 | } 32 | labelPercentage = "\(Int(sender.floatValue * 100))%" 33 | } 34 | 35 | func setProgress(_ progress: CGFloat) { 36 | for view in self.view.subviews { 37 | if view is DeterminateAnimation { 38 | (view as! DeterminateAnimation).progress = progress 39 | } 40 | } 41 | } 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /ProgressKit/InDeterminate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WhatsAppCircular.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 30/06/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | class InDeterminateViewController: NSViewController { 13 | @IBOutlet weak var doing1: DoingCircular! 14 | @IBOutlet weak var doing2: DoingCircular! 15 | @IBOutlet weak var doing3: DoingCircular! 16 | @IBOutlet weak var doing4: DoingCircular! 17 | 18 | override func viewDidLoad() { 19 | preferredContentSize = NSMakeSize(500, 500) 20 | } 21 | 22 | @IBAction func startStopAnimation(sender: NSButton) { 23 | let isOn = sender.state == NSOnState 24 | doing1.animate = isOn 25 | doing2.animate = isOn 26 | doing3.animate = isOn 27 | doing4.animate = isOn 28 | } 29 | } -------------------------------------------------------------------------------- /ProgressKit/InDeterminateVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WhatsAppCircular.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 30/06/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Cocoa 11 | 12 | class InDeterminateViewController: NSViewController { 13 | 14 | override func viewDidAppear() { 15 | for view in self.view.subviews { 16 | (view as? IndeterminateAnimation)?.animate = true 17 | } 18 | } 19 | 20 | override func viewWillDisappear() { 21 | for view in self.view.subviews { 22 | (view as? IndeterminateAnimation)?.animate = false 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ProgressKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015 Kauntey Suryawanshi. All rights reserved. 29 | NSMainStoryboardFile 30 | Main 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /ProgressKitTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ProgressKitTests/ProgressKitTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProgressKitTests.swift 3 | // ProgressKitTests 4 | // 5 | // Created by Kauntey Suryawanshi on 30/06/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import XCTest 11 | 12 | class ProgressKitTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | XCTAssert(true, "Pass") 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /ProgressUtils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProgressUtils.swift 3 | // ProgressKit 4 | // 5 | // Created by Kauntey Suryawanshi on 09/07/15. 6 | // Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved. 7 | // 8 | 9 | 10 | import AppKit 11 | 12 | extension NSRect { 13 | var mid: CGPoint { 14 | return CGPoint(x: self.midX, y: self.midY) 15 | } 16 | } 17 | 18 | extension NSBezierPath { 19 | /// Converts NSBezierPath to CGPath 20 | var CGPath: CGPath { 21 | let path = CGMutablePath() 22 | let points = UnsafeMutablePointer.allocate(capacity: 3) 23 | let numElements = self.elementCount 24 | 25 | for index in 0.. Double { 45 | return Double(degree) * (Double.pi / 180) 46 | } 47 | 48 | func radianToDegree(_ radian: Double) -> Int { 49 | return Int(radian * (180 / Double.pi)) 50 | } 51 | 52 | func + (p1: CGPoint, p2: CGPoint) -> CGPoint { 53 | return CGPoint(x: p1.x + p2.x, y: p1.y + p2.y) 54 | } 55 | 56 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ![ProgressKit Banner](/Images/banner.gif) 3 | 4 | [![Cocoapods Compatible](https://img.shields.io/cocoapods/v/ProgressKit.svg)](https://img.shields.io/cocoapods/v/ProgressKit.svg) 5 | [![Platform](https://img.shields.io/cocoapods/p/ProgressKit.svg?style=flat)](http://cocoadocs.org/docsets/ProgressKit) 6 | [![License](https://img.shields.io/cocoapods/l/ProgressKit.svg?style=flat)](http://cocoadocs.org/docsets/ProgressKit) 7 | 8 | 9 | 10 | `ProgressKit` has set of cool `IBDesignable` progress views, with huge customisation options. 11 | You can now make spinners, progress bar, crawlers etc, which can be finely customised according to your app palette. 12 | 13 | # Contents 14 | - [Installation](#installation) 15 | - [Usage](#usage) 16 | - [Indeterminate Progress](#indeterminate-progress) 17 | - [MaterialProgress](#MaterialProgress) 18 | - [Rainbow](#rainbow) 19 | - [Crawler](#crawler) 20 | - [Spinner](#spinner) 21 | - [Shooting Stars](#shooting-stars) 22 | - [Rotating Arc](#rotating-arc) 23 | - [Determinate Progress](#determinate-progress) 24 | - [Circular Progress](#circular-progress) 25 | - [Progress Bar](#progress-bar) 26 | - [Other Apps](#other-apps) 27 | - [License](#license) 28 | 29 | # Installation 30 | ##CocoaPods 31 | [CocoaPods](http://cocoapods.org) adds supports for Swift and embedded frameworks. 32 | 33 | To integrate ProgressKit into your Xcode project using CocoaPods, specify it in your `Podfile`: 34 | 35 | ```ruby 36 | use_frameworks! 37 | 38 | pod 'ProgressKit' 39 | ``` 40 | For Swift 3 install directly from `swift-3` branch form github 41 | 42 | ```ruby 43 | pod 'ProgressKit', :git => "https://github.com/kaunteya/ProgressKit.git", :branch => 'swift-3' 44 | ``` 45 | 46 | Then, run the following command: 47 | 48 | ```bash 49 | $ pod install 50 | ``` 51 | 52 | # Usage 53 | - Drag a View at desired location in `XIB` or `Storyboard` 54 | - Change the Class to any of the desired progress views 55 | - Set the size such that width and height are equal 56 | - Drag `IBOutlet` to View Controller 57 | - For `Indeterminate` Progress Views 58 | - Set `true / false` to `view.animate` 59 | - For `Determinate` Progress Views: 60 | - Set `view.progress` to value in `0...1` 61 | 62 | 63 | # Indeterminate Progress 64 | 65 | ![Indeterminate](/Images/indeterminate.gif) 66 | Progress indicators which animate indefinately are `Indeterminate Progress` Views. 67 | 68 | This are the set of Indeterminate Progress Indicators. 69 | 70 | ## MaterialProgress 71 | ![CircularSnail](/Images/CircularSnail.gif) 72 | 73 | ## Rainbow 74 | ![Rainbow](/Images/Rainbow.gif) 75 | ## Crawler 76 | ![Crawler](/Images/Crawler.gif) 77 | 78 | ## Spinner 79 | ![Spinner](/Images/Spinner.gif) 80 | 81 | ## Shooting Stars 82 | ![Shooting Stars](/Images/ShootingStars.gif) 83 | 84 | ## Rotating Arc 85 | ![Rotating Arc](/Images/RotatingArc.gif) 86 | 87 | # Determinate Progress 88 | Determinate progress views can be used for tasks whos progress can be seen and determined. 89 | 90 | ## Circular Progress 91 | ![Circular Progress](/Images/CircularProgress.png) 92 | 93 | ## Progress Bar 94 | ![Progress Bar](/Images/ProgressBar.png) 95 | 96 | # Other Apps for Mac 97 | Apart from making Open source libraries I also make apps for Mac OS. Please have a look. 98 | 99 | ## [Lexi](https://apps.apple.com/tr/app/lexi-visual-json-browser/id1462580127?mt=12) 100 | Lexi is a split screen app that lets you browse large JSON with ease. 101 | 102 | It also has other featuers like `Prettify JSON`, `Minify JSON` `Copy JSON Path` and `Pin Large JSON` to narrow your visibility 103 | 104 | [View on Mac AppStore](https://apps.apple.com/tr/app/lexi-visual-json-browser/id1462580127?mt=12) 105 | 106 | ## [Quick Note](https://apps.apple.com/in/app/quicknote-one-click-notes/id1472935217?mt=12) 107 | Quick Note is a Mac OS app, lets you quickly add text either from Menu bar or from Shortcut. 108 | 109 | The text floats on other windows so that they are always visible 110 | 111 | It also supports `Auto Save` and `Pinned Notes` 112 | 113 | [View on Mac AppStore](https://apps.apple.com/in/app/quicknote-one-click-notes/id1472935217?mt=12) 114 | 115 | 116 | 117 | # License 118 | `ProgressKit` is released under the MIT license. See LICENSE for details. 119 | 120 | --------------------------------------------------------------------------------