36 Commits

Author SHA1 Message Date
Kaunteya Suryawanshi ca6e644069 Updated pod spec to 0.6 2016-09-27 00:37:10 +05:30
Kaunteya Suryawanshi cdb141f3a5 Merge pull request #12 from kaunteya/swift-3
Swift 3
2016-09-27 00:35:12 +05:30
Kaunteya Suryawanshi 1d8f558e20 Added Swift 3 installation instruction 2016-09-03 13:06:57 +05:30
Kaunteya Suryawanshi bde87514fc Updated Circular snail for Material progress 2016-09-03 13:00:08 +05:30
Kaunteya Suryawanshi 42e369284b App delegate cleanup 2016-09-03 12:56:36 +05:30
Kaunteya Suryawanshi c2c30f62a1 Updated podspec for Version 1.0 2016-09-03 12:55:01 +05:30
Kaunteya Suryawanshi 51ba0fc1e9 CircularSnail renamed to Material Progress 2016-09-03 12:55:01 +05:30
Kaunteya Suryawanshi 0b5d70f63a Converted to Swift 3 2016-09-03 12:55:00 +05:30
Kaunteya Suryawanshi 69676b77c6 Updated podspec to 0.5.1 2016-08-01 00:22:42 +05:30
Kaunteya Suryawanshi a7a84116ed Updated for Swift 3 compatibility changes 2016-07-24 13:02:13 +05:30
Kaunteya Suryawanshi 423936c334 Minor changes 2016-02-12 17:55:52 +05:30
Kaunteya Suryawanshi 7d84b4e697 Merge pull request #4 from schemers/master
Updated access modifiers of IBInspectable to public so as to make them usable outside of IB
2015-11-22 11:49:37 +05:30
Roland Schemers 27cdcf5c53 Update access modifiers to make usable outside of IB
- make all @IBInspectable properties public

- make BaseView init(frame frameRect: NSRect) public
2015-11-21 19:07:44 -08:00
Kaunteya Suryawanshi 0113a09f57 Added badges 2015-11-10 21:47:08 +05:30
Kaunteya Suryawanshi a3b7a4c3bc Alt for image 2015-11-06 23:17:18 +05:30
Kaunteya Suryawanshi b9fef1fb29 Minor changes in README 2015-11-05 22:26:22 +05:30
Kaunteya Suryawanshi 9f7a41e2d8 Updated tag to 0.4.1 2015-11-05 22:21:49 +05:30
Kaunteya Suryawanshi c6b46dcd53 Updated access modifiers 2015-11-05 22:20:23 +05:30
Kaunteya Suryawanshi 6a729e96e3 Updated the podspec for 0.4.0 2015-10-27 11:41:00 +05:30
Kaunteya Suryawanshi 56e1225dc5 Merge pull request #2 from kaunteya/RotatingArc
Rotating arc
2015-10-26 17:23:08 +05:30
Kaunteya Suryawanshi 885748e33b Added rotating arc 2015-10-26 17:18:38 +05:30
Kaunteya Suryawanshi aa22de6564 Scaled down Rotating arc 2015-10-26 17:16:47 +05:30
Kaunteya Suryawanshi 7dac890d47 Scaled down indeterminate inamge 2015-10-26 17:14:42 +05:30
Kaunteya Suryawanshi 9c22dbe3a2 Updated Rotating Arc 2015-10-26 17:11:06 +05:30
Kaunteya Suryawanshi 85187f38ff Added rotating arc 2015-10-26 17:00:44 +05:30
Kaunteya Suryawanshi 99f861f760 Fixed the paths that were closing automatically 2015-10-26 15:43:06 +05:30
Kaunteya Suryawanshi 598179a53d Added more indeterminate animations 2015-10-26 14:45:19 +05:30
Kaunteya Suryawanshi b3e3befc89 Added rainbow demo 2015-10-26 14:40:49 +05:30
Kaunteya Suryawanshi e9050e3774 Added rainbow in demo 2015-10-26 14:35:47 +05:30
Kaunteya Suryawanshi 8433775d96 Added gif of ShootingStar 2015-10-26 14:28:27 +05:30
Kaunteya Suryawanshi 675dd9496c Auto updated animation tag in storyboard 2015-10-26 14:17:22 +05:30
Kaunteya Suryawanshi de95fd9ee8 Added documentation comments for Indeterminate animation 2015-10-24 11:35:34 +05:30
Kaunteya Suryawanshi 6f53f86b63 do_ to do(as per Swift 2) 2015-10-24 00:26:50 +05:30
Kaunteya Suryawanshi 2594ac2584 Added utilities to ProgressUtils 2015-10-24 00:25:52 +05:30
Kaunteya Suryawanshi f7da0a11a0 Updated podspec 2015-10-08 12:49:13 +05:30
Kaunteya Suryawanshi 31c3ec2510 Updated 2015-10-08 12:47:48 +05:30
24 changed files with 606 additions and 185 deletions
+6 -6
View File
@@ -9,9 +9,9 @@
import AppKit
@IBDesignable
public class BaseView : NSView {
open class BaseView : NSView {
override init(frame frameRect: NSRect) {
override public init(frame frameRect: NSRect) {
super.init(frame: frameRect)
self.configureLayers()
}
@@ -27,19 +27,19 @@ public class BaseView : NSView {
notifyViewRedesigned()
}
@IBInspectable var background: NSColor = NSColor(red: 88.3 / 256, green: 104.4 / 256, blue: 118.5 / 256, alpha: 1.0) {
@IBInspectable open var background: NSColor = NSColor(red: 88.3 / 256, green: 104.4 / 256, blue: 118.5 / 256, alpha: 1.0) {
didSet {
self.notifyViewRedesigned()
}
}
@IBInspectable var foreground: NSColor = NSColor(red: 66.3 / 256, green: 173.7 / 256, blue: 106.4 / 256, alpha: 1.0) {
@IBInspectable open var foreground: NSColor = NSColor(red: 66.3 / 256, green: 173.7 / 256, blue: 106.4 / 256, alpha: 1.0) {
didSet {
self.notifyViewRedesigned()
}
}
@IBInspectable var cornerRadius: CGFloat = 5.0 {
@IBInspectable open var cornerRadius: CGFloat = 5.0 {
didSet {
self.notifyViewRedesigned()
}
@@ -47,7 +47,7 @@ public class BaseView : NSView {
/// Call when any IBInspectable variable is changed
func notifyViewRedesigned() {
self.layer?.backgroundColor = background.CGColor
self.layer?.backgroundColor = background.cgColor
self.layer?.cornerRadius = cornerRadius
}
}
+18 -18
View File
@@ -10,19 +10,19 @@ import Foundation
import Cocoa
@IBDesignable
public class CircularProgressView: DeterminateAnimation {
open class CircularProgressView: DeterminateAnimation {
var backgroundCircle = CAShapeLayer()
var progressLayer = CAShapeLayer()
var percentLabelLayer = CATextLayer()
@IBInspectable var strokeWidth: CGFloat = -1 {
@IBInspectable open var strokeWidth: CGFloat = -1 {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var showPercent: Bool = true {
@IBInspectable open var showPercent: Bool = true {
didSet {
notifyViewRedesigned()
}
@@ -32,11 +32,11 @@ public class CircularProgressView: DeterminateAnimation {
super.notifyViewRedesigned()
backgroundCircle.lineWidth = self.strokeWidth / 2
progressLayer.lineWidth = strokeWidth
percentLabelLayer.hidden = !showPercent
percentLabelLayer.isHidden = !showPercent
backgroundCircle.strokeColor = foreground.colorWithAlphaComponent(0.5).CGColor
progressLayer.strokeColor = foreground.CGColor
percentLabelLayer.foregroundColor = foreground.CGColor
backgroundCircle.strokeColor = foreground.withAlphaComponent(0.5).cgColor
progressLayer.strokeColor = foreground.cgColor
percentLabelLayer.foregroundColor = foreground.cgColor
}
override func updateProgress() {
@@ -61,40 +61,40 @@ public class CircularProgressView: DeterminateAnimation {
// Add background Circle
do_ {
do {
backgroundCircle.frame = rect
backgroundCircle.lineWidth = strokeWidth == -1 ? (rect.width * strokeScalingFactor / 2) : strokeWidth / 2
backgroundCircle.strokeColor = foreground.colorWithAlphaComponent(0.5).CGColor
backgroundCircle.fillColor = NSColor.clearColor().CGColor
backgroundCircle.strokeColor = foreground.withAlphaComponent(0.5).cgColor
backgroundCircle.fillColor = NSColor.clear.cgColor
let backgroundPath = NSBezierPath()
backgroundPath.appendBezierPathWithArcWithCenter(rect.mid, radius: radius, startAngle: 0, endAngle: 360)
backgroundPath.appendArc(withCenter: rect.mid, radius: radius, startAngle: 0, endAngle: 360)
backgroundCircle.path = backgroundPath.CGPath
self.layer?.addSublayer(backgroundCircle)
}
// Progress Layer
do_ {
do {
progressLayer.strokeEnd = 0 //REMOVe this
progressLayer.fillColor = NSColor.clearColor().CGColor
progressLayer.fillColor = NSColor.clear.cgColor
progressLayer.lineCap = kCALineCapRound
progressLayer.lineWidth = strokeWidth == -1 ? (rect.width * strokeScalingFactor) : strokeWidth
progressLayer.frame = rect
progressLayer.strokeColor = foreground.CGColor
progressLayer.strokeColor = foreground.cgColor
let arcPath = NSBezierPath()
let startAngle = CGFloat(90)
arcPath.appendBezierPathWithArcWithCenter(rect.mid, radius: radius, startAngle: startAngle, endAngle: (startAngle - 360), clockwise: true)
arcPath.appendArc(withCenter: rect.mid, radius: radius, startAngle: startAngle, endAngle: (startAngle - 360), clockwise: true)
progressLayer.path = arcPath.CGPath
self.layer?.addSublayer(progressLayer)
}
// Percentage Layer
do_ {
do {
percentLabelLayer.string = "0%"
percentLabelLayer.foregroundColor = foreground.CGColor
percentLabelLayer.foregroundColor = foreground.cgColor
percentLabelLayer.frame = rect
percentLabelLayer.font = "Helvetica Neue Light"
percentLabelLayer.font = "Helvetica Neue Light" as CFTypeRef
percentLabelLayer.alignmentMode = kCAAlignmentCenter
percentLabelLayer.position.y = rect.midY * 0.25
percentLabelLayer.fontSize = rect.width * 0.2
+3 -3
View File
@@ -14,12 +14,12 @@ protocol DeterminableAnimation {
}
@IBDesignable
public class DeterminateAnimation: BaseView, DeterminableAnimation {
open class DeterminateAnimation: BaseView, DeterminableAnimation {
@IBInspectable var animated: Bool = true
@IBInspectable open var animated: Bool = true
/// Value of progress now. Range 0..1
@IBInspectable var progress: CGFloat = 0 {
@IBInspectable open var progress: CGFloat = 0 {
didSet {
updateProgress()
}
+5 -5
View File
@@ -10,12 +10,12 @@ import Foundation
import Cocoa
@IBDesignable
public class ProgressBar: DeterminateAnimation {
open class ProgressBar: DeterminateAnimation {
var borderLayer = CAShapeLayer()
var progressLayer = CAShapeLayer()
@IBInspectable var borderColor: NSColor = NSColor.blackColor() {
@IBInspectable open var borderColor: NSColor = NSColor.black {
didSet {
notifyViewRedesigned()
}
@@ -24,8 +24,8 @@ public class ProgressBar: DeterminateAnimation {
override func notifyViewRedesigned() {
super.notifyViewRedesigned()
self.layer?.cornerRadius = self.frame.height / 2
borderLayer.borderColor = borderColor.CGColor
progressLayer.backgroundColor = foreground.CGColor
borderLayer.borderColor = borderColor.cgColor
progressLayer.backgroundColor = foreground.cgColor
}
override func configureLayers() {
@@ -39,7 +39,7 @@ public class ProgressBar: DeterminateAnimation {
progressLayer.frame = NSInsetRect(borderLayer.bounds, 3, 3)
progressLayer.frame.size.width = (borderLayer.bounds.width - 6)
progressLayer.cornerRadius = progressLayer.frame.height / 2
progressLayer.backgroundColor = foreground.CGColor
progressLayer.backgroundColor = foreground.cgColor
borderLayer.addSublayer(progressLayer)
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 KiB

After

Width:  |  Height:  |  Size: 316 KiB

+11 -10
View File
@@ -9,12 +9,12 @@
import Foundation
import Cocoa
private let defaultForegroundColor = NSColor.whiteColor()
private let defaultForegroundColor = NSColor.white
private let defaultBackgroundColor = NSColor(white: 0.0, alpha: 0.4)
private let duration = 1.2
@IBDesignable
public class Crawler: IndeterminateAnimation {
open class Crawler: IndeterminateAnimation {
var starList = [CAShapeLayer]()
@@ -27,32 +27,33 @@ public class Crawler: IndeterminateAnimation {
override func notifyViewRedesigned() {
super.notifyViewRedesigned()
for star in starList {
star.backgroundColor = foreground.CGColor
star.backgroundColor = foreground.cgColor
}
}
override func configureLayers() {
super.configureLayers()
let rect = self.bounds
let insetRect = NSInsetRect(rect, rect.width * 0.15, rect.width * 0.15)
for var i = 0.0; i < 5; i++ {
for i in 0 ..< 5 {
let starShape = CAShapeLayer()
starList.append(starShape)
starShape.backgroundColor = foreground.CGColor
starShape.backgroundColor = foreground.cgColor
let circleWidth = smallCircleSize - i * 2
let circleWidth = smallCircleSize - Double(i) * 2
starShape.bounds = CGRect(x: 0, y: 0, width: circleWidth, height: circleWidth)
starShape.cornerRadius = CGFloat(circleWidth / 2)
starShape.position = CGPoint(x: rect.midX, y: rect.midY + insetRect.height / 2)
self.layer?.addSublayer(starShape)
let arcPath = NSBezierPath()
arcPath.appendBezierPathWithArcWithCenter(insetRect.mid, radius: insetRect.width / 2, startAngle: 90, endAngle: -360 + 90, clockwise: true)
arcPath.appendArc(withCenter: insetRect.mid, radius: insetRect.width / 2, startAngle: 90, endAngle: -360 + 90, clockwise: true)
let rotationAnimation = CAKeyframeAnimation(keyPath: "position")
rotationAnimation.path = arcPath.CGPath
rotationAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
rotationAnimation.beginTime = (duration * 0.075) * i
rotationAnimation.beginTime = (duration * 0.075) * Double(i)
rotationAnimation.calculationMode = kCAAnimationCubicPaced
let animationGroup = CAAnimationGroup()
@@ -65,8 +66,8 @@ public class Crawler: IndeterminateAnimation {
}
override func startAnimation() {
for (index, star) in starList.enumerate() {
star.addAnimation(animationGroups[index], forKey: "")
for (index, star) in starList.enumerated() {
star.add(animationGroups[index], forKey: "")
}
}
+26 -8
View File
@@ -6,34 +6,52 @@
// Copyright (c) 2015 Kauntey Suryawanshi. All rights reserved.
//
import Foundation
import Cocoa
protocol AnimationActivityProtocol {
protocol AnimationStatusDelegate {
func startAnimation()
func stopAnimation()
}
public class IndeterminateAnimation: BaseView, AnimationActivityProtocol {
@IBInspectable var displayAfterAnimationEnds: Bool = false
open class IndeterminateAnimation: BaseView, AnimationStatusDelegate {
var animate: Bool = false {
/// View is hidden when *animate* property is false
@IBInspectable open var displayAfterAnimationEnds: Bool = false
/**
Control point for all Indeterminate animation
True invokes `startAnimation()` on subclass of IndeterminateAnimation
False invokes `stopAnimation()` on subclass of IndeterminateAnimation
*/
open var animate: Bool = false {
didSet {
guard animate != oldValue else { return }
if animate {
self.hidden = false
self.isHidden = false
startAnimation()
} else {
if !displayAfterAnimationEnds {
self.hidden = true
self.isHidden = true
}
stopAnimation()
}
}
}
/**
Every function that extends Indeterminate animation must define startAnimation().
`animate` property of Indeterminate animation will indynamically invoke the subclass method
*/
func startAnimation() {
fatalError("This is an abstract function")
}
/**
Every function that extends Indeterminate animation must define **stopAnimation()**.
*animate* property of Indeterminate animation will dynamically invoke the subclass method
*/
func stopAnimation() {
fatalError("This is an abstract function")
}
}
}
@@ -1,5 +1,5 @@
//
// WhatsAppCircular.swift
// MaterialProgress.swift
// ProgressKit
//
// Created by Kauntey Suryawanshi on 30/06/15.
@@ -13,9 +13,9 @@ private let duration = 1.5
private let strokeRange = (start: 0.0, end: 0.8)
@IBDesignable
public class CircularSnail: IndeterminateAnimation {
open class MaterialProgress: IndeterminateAnimation {
@IBInspectable var lineWidth: CGFloat = -1 {
@IBInspectable open var lineWidth: CGFloat = -1 {
didSet {
progressLayer.lineWidth = lineWidth
}
@@ -23,7 +23,7 @@ public class CircularSnail: IndeterminateAnimation {
override func notifyViewRedesigned() {
super.notifyViewRedesigned()
progressLayer.strokeColor = foreground.CGColor
progressLayer.strokeColor = foreground.cgColor
}
var backgroundRotationLayer = CAShapeLayer()
@@ -32,7 +32,7 @@ public class CircularSnail: IndeterminateAnimation {
var tempLayer = CAShapeLayer()
tempLayer.strokeEnd = CGFloat(strokeRange.end)
tempLayer.lineCap = kCALineCapRound
tempLayer.fillColor = NSColor.clearColor().CGColor
tempLayer.fillColor = NSColor.clear.cgColor
return tempLayer
}()
@@ -50,7 +50,7 @@ public class CircularSnail: IndeterminateAnimation {
tempRotation.repeatCount = Float.infinity
tempRotation.fromValue = 0
tempRotation.toValue = 1
tempRotation.cumulative = true
tempRotation.isCumulative = true
tempRotation.duration = duration / 2
return tempRotation
}()
@@ -60,7 +60,7 @@ public class CircularSnail: IndeterminateAnimation {
var strokeStartAnimation: CABasicAnimation!
var strokeEndAnimation: CABasicAnimation!
func makeAnimationforKeyPath(keyPath: String) -> CABasicAnimation {
func makeAnimationforKeyPath(_ keyPath: String) -> CABasicAnimation {
let tempAnimation = CABasicAnimation(keyPath: keyPath)
tempAnimation.repeatCount = 1
tempAnimation.speed = 2.0
@@ -92,30 +92,33 @@ public class CircularSnail: IndeterminateAnimation {
progressLayer.frame = rect
progressLayer.lineWidth = lineWidth == -1 ? radius / 10: lineWidth
let arcPath = NSBezierPath()
arcPath.appendBezierPathWithArcWithCenter(rect.mid, radius: radius, startAngle: 0, endAngle: 360, clockwise: false)
arcPath.appendArc(withCenter: rect.mid, radius: radius, startAngle: 0, endAngle: 360, clockwise: false)
progressLayer.path = arcPath.CGPath
backgroundRotationLayer.addSublayer(progressLayer)
}
var currentRotation = 0.0
let π2 = M_PI * 2
override public func animationDidStop(anim: CAAnimation, finished flag: Bool) {
if !animate { return }
CATransaction.begin()
CATransaction.setDisableActions(true)
currentRotation += strokeRange.end * π2
currentRotation %= π2
progressLayer.setAffineTransform(CGAffineTransformMakeRotation(CGFloat( currentRotation)))
CATransaction.commit()
progressLayer.addAnimation(animationGroup, forKey: "strokeEnd")
}
override func startAnimation() {
progressLayer.addAnimation(animationGroup, forKey: "strokeEnd")
backgroundRotationLayer.addAnimation(rotationAnimation, forKey: rotationAnimation.keyPath)
progressLayer.add(animationGroup, forKey: "strokeEnd")
backgroundRotationLayer.add(rotationAnimation, forKey: rotationAnimation.keyPath)
}
override func stopAnimation() {
backgroundRotationLayer.removeAllAnimations()
progressLayer.removeAllAnimations()
}
}
extension MaterialProgress: CAAnimationDelegate {
open func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
if !animate { return }
CATransaction.begin()
CATransaction.setDisableActions(true)
currentRotation += strokeRange.end * π2
currentRotation = currentRotation.truncatingRemainder(dividingBy: π2)
progressLayer.setAffineTransform(CGAffineTransform(rotationAngle: CGFloat( currentRotation)))
CATransaction.commit()
progressLayer.add(animationGroup, forKey: "strokeEnd")
}
}
+9 -10
View File
@@ -10,30 +10,29 @@ import Foundation
import Cocoa
@IBDesignable
public class Rainbow: CircularSnail {
open class Rainbow: MaterialProgress {
@IBInspectable var onLightOffDark: Bool = false
@IBInspectable open var onLightOffDark: Bool = false
override func configureLayers() {
super.configureLayers()
self.background = NSColor.clearColor()
self.background = NSColor.clear
}
override public func animationDidStop(anim: CAAnimation, finished flag: Bool) {
override open func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
super.animationDidStop(anim, finished: flag)
if onLightOffDark {
progressLayer.strokeColor = lightColorList[Int(arc4random()) % lightColorList.count].CGColor
progressLayer.strokeColor = lightColorList[Int(arc4random()) % lightColorList.count].cgColor
} else {
progressLayer.strokeColor = darkColorList[Int(arc4random()) % darkColorList.count].CGColor
progressLayer.strokeColor = darkColorList[Int(arc4random()) % darkColorList.count].cgColor
}
}
}
var randomColor: NSColor {
let red = CGFloat(Double(arc4random()) % 256.0 / 256.0)
let green = CGFloat(Double(arc4random()) % 256.0 / 256.0)
let blue = CGFloat(Double(arc4random()) % 256.0 / 256.0)
let red = CGFloat(Double(arc4random()).truncatingRemainder(dividingBy: 256.0) / 256.0)
let green = CGFloat(Double(arc4random()).truncatingRemainder(dividingBy: 256.0) / 256.0)
let blue = CGFloat(Double(arc4random()).truncatingRemainder(dividingBy: 256.0) / 256.0)
return NSColor(calibratedRed: red, green: green, blue: blue, alpha: 1.0)
}
+104
View File
@@ -0,0 +1,104 @@
//
// RotatingArc.swift
// ProgressKit
//
// Created by Kauntey Suryawanshi on 26/10/15.
// Copyright © 2015 Kauntey Suryawanshi. All rights reserved.
//
import Foundation
import Cocoa
private let duration = 0.25
@IBDesignable
open class RotatingArc: IndeterminateAnimation {
var backgroundCircle = CAShapeLayer()
var arcLayer = CAShapeLayer()
@IBInspectable open var strokeWidth: CGFloat = 5 {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable open var arcLength: Int = 35 {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable open var clockWise: Bool = true {
didSet {
notifyViewRedesigned()
}
}
var radius: CGFloat {
return (self.frame.width / 2) * CGFloat(0.75)
}
var rotationAnimation: CABasicAnimation = {
var tempRotation = CABasicAnimation(keyPath: "transform.rotation")
tempRotation.repeatCount = Float.infinity
tempRotation.fromValue = 0
tempRotation.toValue = 1
tempRotation.isCumulative = true
tempRotation.duration = duration
return tempRotation
}()
override func notifyViewRedesigned() {
super.notifyViewRedesigned()
arcLayer.strokeColor = foreground.cgColor
backgroundCircle.strokeColor = foreground.withAlphaComponent(0.4).cgColor
backgroundCircle.lineWidth = self.strokeWidth
arcLayer.lineWidth = strokeWidth
rotationAnimation.toValue = clockWise ? -1 : 1
let arcPath = NSBezierPath()
let endAngle: CGFloat = CGFloat(-360) * CGFloat(arcLength) / 100
arcPath.appendArc(withCenter: self.bounds.mid, radius: radius, startAngle: 0, endAngle: endAngle, clockwise: true)
arcLayer.path = arcPath.CGPath
}
override func configureLayers() {
super.configureLayers()
let rect = self.bounds
// Add background Circle
do {
backgroundCircle.frame = rect
backgroundCircle.lineWidth = strokeWidth
backgroundCircle.strokeColor = foreground.withAlphaComponent(0.5).cgColor
backgroundCircle.fillColor = NSColor.clear.cgColor
let backgroundPath = NSBezierPath()
backgroundPath.appendArc(withCenter: rect.mid, radius: radius, startAngle: 0, endAngle: 360)
backgroundCircle.path = backgroundPath.CGPath
self.layer?.addSublayer(backgroundCircle)
}
// Arc Layer
do {
arcLayer.fillColor = NSColor.clear.cgColor
arcLayer.lineWidth = strokeWidth
arcLayer.frame = rect
arcLayer.strokeColor = foreground.cgColor
self.layer?.addSublayer(arcLayer)
}
}
override func startAnimation() {
arcLayer.add(rotationAnimation, forKey: "")
}
override func stopAnimation() {
arcLayer.removeAllAnimations()
}
}
+18 -16
View File
@@ -10,8 +10,8 @@ import Foundation
import Cocoa
@IBDesignable
public class ShootingStars: IndeterminateAnimation {
private let animationDuration = 1.0
open class ShootingStars: IndeterminateAnimation {
fileprivate let animationDuration = 1.0
var starLayer1 = CAShapeLayer()
var starLayer2 = CAShapeLayer()
@@ -20,8 +20,8 @@ public class ShootingStars: IndeterminateAnimation {
override func notifyViewRedesigned() {
super.notifyViewRedesigned()
starLayer1.backgroundColor = foreground.CGColor
starLayer2.backgroundColor = foreground.CGColor
starLayer1.backgroundColor = foreground.cgColor
starLayer2.backgroundColor = foreground.cgColor
}
override func configureLayers() {
@@ -34,25 +34,25 @@ public class ShootingStars: IndeterminateAnimation {
self.layer?.cornerRadius = 0
/// Add Stars
do_ {
do {
starLayer1.position = CGPoint(x: dimension / 2, y: dimension / 2)
starLayer1.bounds.size = CGSize(width: starWidth, height: dimension)
starLayer1.backgroundColor = foreground.CGColor
starLayer1.backgroundColor = foreground.cgColor
self.layer?.addSublayer(starLayer1)
starLayer2.position = CGPoint(x: rect.midX, y: dimension / 2)
starLayer2.bounds.size = CGSize(width: starWidth, height: dimension)
starLayer2.backgroundColor = foreground.CGColor
starLayer2.backgroundColor = foreground.cgColor
self.layer?.addSublayer(starLayer2)
}
/// Add default animation
do_ {
do {
animation.fromValue = -dimension
animation.toValue = rect.width * 0.9
animation.duration = animationDuration
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
animation.removedOnCompletion = false
animation.isRemovedOnCompletion = false
animation.repeatCount = Float.infinity
}
@@ -66,15 +66,11 @@ public class ShootingStars: IndeterminateAnimation {
tempAnimation.duration = animationDuration / 2
tempAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
}
override public func animationDidStop(anim: CAAnimation, finished flag: Bool) {
starLayer2.addAnimation(animation, forKey: "default")
}
//MARK: Indeterminable protocol
override func startAnimation() {
starLayer1.addAnimation(animation, forKey: "default")
starLayer2.addAnimation(tempAnimation, forKey: "tempAnimation")
starLayer1.add(animation, forKey: "default")
starLayer2.add(tempAnimation, forKey: "tempAnimation")
}
override func stopAnimation() {
@@ -82,3 +78,9 @@ public class ShootingStars: IndeterminateAnimation {
starLayer2.removeAllAnimations()
}
}
extension ShootingStars: CAAnimationDelegate {
open func animationDidStop(_ anim: CAAnimation, finished flag: Bool) {
starLayer2.add(animation, forKey: "default")
}
}
+13 -12
View File
@@ -10,7 +10,7 @@ import Foundation
import Cocoa
@IBDesignable
public class Spinner: IndeterminateAnimation {
open class Spinner: IndeterminateAnimation {
var basicShape = CAShapeLayer()
var containerLayer = CAShapeLayer()
@@ -23,38 +23,38 @@ public class Spinner: IndeterminateAnimation {
return animation
}()
@IBInspectable var starSize:CGSize = CGSize(width: 6, height: 15) {
@IBInspectable open var starSize:CGSize = CGSize(width: 6, height: 15) {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var roundedCorners: Bool = true {
@IBInspectable open var roundedCorners: Bool = true {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var distance: CGFloat = CGFloat(20) {
@IBInspectable open var distance: CGFloat = CGFloat(20) {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var starCount: Int = 10 {
@IBInspectable open var starCount: Int = 10 {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var duration: Double = 1 {
@IBInspectable open var duration: Double = 1 {
didSet {
animation.duration = duration
}
}
@IBInspectable var clockwise: Bool = false {
@IBInspectable open var clockwise: Bool = false {
didSet {
notifyViewRedesigned()
}
@@ -72,11 +72,11 @@ public class Spinner: IndeterminateAnimation {
override func notifyViewRedesigned() {
super.notifyViewRedesigned()
starList.removeAll(keepCapacity: true)
starList.removeAll(keepingCapacity: true)
containerLayer.sublayers = nil
animation.values = [Double]()
for var i = 0.0; i < 360; i = i + Double(360 / starCount) {
var i = 0.0
while i < 360 {
var iRadian = CGFloat(i * M_PI / 180.0)
if clockwise { iRadian = -iRadian }
@@ -88,7 +88,7 @@ public class Spinner: IndeterminateAnimation {
starShape.frame = CGRect(origin: centerLocation, size: starSize)
starShape.backgroundColor = foreground.CGColor
starShape.backgroundColor = foreground.cgColor
starShape.anchorPoint = CGPoint(x: 0.5, y: 0)
var rotation: CATransform3D = CATransform3DMakeTranslation(0, 0, 0.0);
@@ -100,11 +100,12 @@ public class Spinner: IndeterminateAnimation {
starShape.opacity = Float(360 - i) / 360
containerLayer.addSublayer(starShape)
starList.append(starShape)
i = i + Double(360 / starCount)
}
}
override func startAnimation() {
containerLayer.addAnimation(animation, forKey: "rotation")
containerLayer.add(animation, forKey: "rotation")
}
override func stopAnimation() {
+2 -2
View File
@@ -1,8 +1,8 @@
Pod::Spec.new do |spec|
spec.name = 'ProgressKit'
spec.version = '0.2.0'
spec.version = '0.6'
spec.license = 'MIT'
spec.summary = 'Animated ProgressViews for OSX'
spec.summary = 'Animated ProgressViews for macOS'
spec.homepage = 'https://github.com/kaunteya/ProgressKit'
spec.authors = { 'Kaunteya Suryawanshi' => 'k.suryawanshi@gmail.com' }
spec.source = { :git => 'https://github.com/kaunteya/ProgressKit.git', :tag => spec.version }
+28 -5
View File
@@ -7,11 +7,14 @@
objects = {
/* Begin PBXBuildFile section */
E310B1D31D7AB2D4008DEF62 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = E310B1D21D7AB2D4008DEF62 /* README.md */; };
E310B1D51D7AB2EA008DEF62 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = E310B1D41D7AB2EA008DEF62 /* LICENSE */; };
E31617A61BC0596C007AD70F /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E31617A51BC0596C007AD70F /* BaseView.swift */; };
E340FDB81BDE45F000CE6550 /* RotatingArc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E340FDB71BDE45F000CE6550 /* RotatingArc.swift */; };
E35D1C6C1B676889001DBAF2 /* Spinner.swift in Sources */ = {isa = PBXBuildFile; fileRef = E35D1C6B1B676889001DBAF2 /* Spinner.swift */; };
E37568DF1B6AAB530073E26F /* ProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = E37568DE1B6AAB530073E26F /* ProgressBar.swift */; };
E3918F811B4E88CF00558DAB /* CircularProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F801B4E88CF00558DAB /* CircularProgressView.swift */; };
E3918F841B4E88DE00558DAB /* CircularSnail.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F821B4E88DE00558DAB /* CircularSnail.swift */; };
E3918F841B4E88DE00558DAB /* MaterialProgress.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F821B4E88DE00558DAB /* MaterialProgress.swift */; };
E3918F851B4E88DE00558DAB /* ShootingStars.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F831B4E88DE00558DAB /* ShootingStars.swift */; };
E3918F8D1B4E8AB100558DAB /* IndeterminateAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F8C1B4E8AB100558DAB /* IndeterminateAnimation.swift */; };
E3918F8F1B4E8C2900558DAB /* DeterminateAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3918F8E1B4E8C2900558DAB /* DeterminateAnimation.swift */; };
@@ -37,11 +40,14 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
E310B1D21D7AB2D4008DEF62 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; };
E310B1D41D7AB2EA008DEF62 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; };
E31617A51BC0596C007AD70F /* BaseView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseView.swift; sourceTree = "<group>"; };
E340FDB71BDE45F000CE6550 /* RotatingArc.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RotatingArc.swift; path = InDeterminate/RotatingArc.swift; sourceTree = "<group>"; };
E35D1C6B1B676889001DBAF2 /* Spinner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Spinner.swift; path = InDeterminate/Spinner.swift; sourceTree = "<group>"; };
E37568DE1B6AAB530073E26F /* ProgressBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ProgressBar.swift; path = Determinate/ProgressBar.swift; sourceTree = "<group>"; };
E3918F801B4E88CF00558DAB /* CircularProgressView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CircularProgressView.swift; path = Determinate/CircularProgressView.swift; sourceTree = "<group>"; };
E3918F821B4E88DE00558DAB /* CircularSnail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CircularSnail.swift; path = InDeterminate/CircularSnail.swift; sourceTree = "<group>"; };
E3918F821B4E88DE00558DAB /* MaterialProgress.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MaterialProgress.swift; path = InDeterminate/MaterialProgress.swift; sourceTree = "<group>"; };
E3918F831B4E88DE00558DAB /* ShootingStars.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ShootingStars.swift; path = InDeterminate/ShootingStars.swift; sourceTree = "<group>"; };
E3918F8C1B4E8AB100558DAB /* IndeterminateAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IndeterminateAnimation.swift; path = InDeterminate/IndeterminateAnimation.swift; sourceTree = "<group>"; };
E3918F8E1B4E8C2900558DAB /* DeterminateAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DeterminateAnimation.swift; path = Determinate/DeterminateAnimation.swift; sourceTree = "<group>"; };
@@ -82,11 +88,12 @@
isa = PBXGroup;
children = (
E3918F8C1B4E8AB100558DAB /* IndeterminateAnimation.swift */,
E3918F821B4E88DE00558DAB /* CircularSnail.swift */,
E3918F821B4E88DE00558DAB /* MaterialProgress.swift */,
E3918FA71B4ECF7100558DAB /* Rainbow.swift */,
E3A468511B5434F7006DDE31 /* Crawler.swift */,
E3918F831B4E88DE00558DAB /* ShootingStars.swift */,
E35D1C6B1B676889001DBAF2 /* Spinner.swift */,
E340FDB71BDE45F000CE6550 /* RotatingArc.swift */,
);
name = Indeterminate;
sourceTree = "<group>";
@@ -137,6 +144,8 @@
E3AD65D51B426758009541CD /* Supporting Files */ = {
isa = PBXGroup;
children = (
E310B1D21D7AB2D4008DEF62 /* README.md */,
E310B1D41D7AB2EA008DEF62 /* LICENSE */,
E3CCD5991BBC2B9B00F7DB9A /* ProgressUtils.swift */,
E3CCD5971BBC19ED00F7DB9A /* ProgressKit.podspec */,
E3AD65D61B426758009541CD /* Info.plist */,
@@ -207,14 +216,16 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = "Kauntey Suryawanshi";
TargetAttributes = {
E3AD65D11B426758009541CD = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0800;
};
E3AD65E31B426758009541CD = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0800;
TestTargetID = E3AD65D11B426758009541CD;
};
};
@@ -243,6 +254,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E310B1D51D7AB2EA008DEF62 /* LICENSE in Resources */,
E3CCD5981BBC19ED00F7DB9A /* ProgressKit.podspec in Resources */,
E3AD65DF1B426758009541CD /* Main.storyboard in Resources */,
);
@@ -268,10 +280,12 @@
E3AD65F71B427511009541CD /* InDeterminateVC.swift in Sources */,
E3918F851B4E88DE00558DAB /* ShootingStars.swift in Sources */,
E3918F811B4E88CF00558DAB /* CircularProgressView.swift in Sources */,
E310B1D31D7AB2D4008DEF62 /* README.md in Sources */,
E35D1C6C1B676889001DBAF2 /* Spinner.swift in Sources */,
E3918F841B4E88DE00558DAB /* CircularSnail.swift in Sources */,
E3918F841B4E88DE00558DAB /* MaterialProgress.swift in Sources */,
E3AD65D81B426758009541CD /* AppDelegate.swift in Sources */,
E37568DF1B6AAB530073E26F /* ProgressBar.swift in Sources */,
E340FDB81BDE45F000CE6550 /* RotatingArc.swift in Sources */,
E3CCD59A1BBC2B9B00F7DB9A /* ProgressUtils.swift in Sources */,
E31617A61BC0596C007AD70F /* BaseView.swift in Sources */,
E3918FA81B4ECF7100558DAB /* Rainbow.swift in Sources */,
@@ -322,8 +336,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
@@ -367,8 +383,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
@@ -387,6 +405,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
};
name = Release;
};
@@ -399,6 +418,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
@@ -411,6 +431,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
@@ -431,6 +452,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit";
};
name = Debug;
@@ -448,6 +470,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit";
};
name = Release;
+3 -7
View File
@@ -11,16 +11,12 @@ import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(aNotification: NSNotification) {
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
}
func applicationWillTerminate(aNotification: NSNotification) {
// Insert code here to tear down your application
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
}
+272 -18
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="11198.2" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11198.2"/>
</dependencies>
<scenes>
<!--Application-->
@@ -666,7 +666,7 @@
<!--Tab View Controller-->
<scene sceneID="rXQ-85-vI9">
<objects>
<tabViewController selectedTabViewItemIndex="0" id="GTh-XG-eDn" sceneMemberID="viewController">
<tabViewController selectedTabViewItemIndex="1" id="GTh-XG-eDn" sceneMemberID="viewController">
<tabViewItems>
<tabViewItem label="Determinate" id="90h-OW-Y1a"/>
<tabViewItem label="Indeterminate" id="T4v-4q-PhE"/>
@@ -694,11 +694,13 @@
<rect key="frame" x="0.0" y="0.0" width="500" height="184"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qjG-BT-qLK" customClass="CircularSnail" customModule="ProgressKit" customModuleProvider="target">
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qjG-BT-qLK" customClass="MaterialProgress" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="84" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8Ph-2H-wiR">
<rect key="frame" x="59" y="59" width="41" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="inline" title="More" bezelStyle="inline" alignment="center" borderStyle="border" inset="2" id="lBv-3R-Zg0">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystemBold"/>
@@ -708,7 +710,8 @@
</connections>
</button>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3VR-oT-y2I" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="304" y="84" width="80" height="80"/>
<rect key="frame" x="250" y="84" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="7" height="14"/>
@@ -720,13 +723,15 @@
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="haM-Vg-aIY" customClass="Crawler" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="160" y="84" width="80" height="80"/>
<rect key="frame" x="129" y="84" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="displayAfterAnimationEnds" value="YES"/>
</userDefinedRuntimeAttributes>
</customView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Npu-8G-HkC">
<rect key="frame" x="199" y="59" width="41" height="17"/>
<rect key="frame" x="168" y="59" width="41" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="inline" title="More" bezelStyle="inline" alignment="center" borderStyle="border" inset="2" id="SqX-Fr-AwH">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystemBold"/>
@@ -737,6 +742,7 @@
</button>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kmB-H3-AT2" customClass="ShootingStars" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="34" width="438" height="3"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" white="1" alpha="1" colorSpace="calibratedWhite"/>
@@ -748,6 +754,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NfH-n9-vtu" customClass="ShootingStars" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="11" width="438" height="3"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<shadow key="shadow" blurRadius="1">
<color key="color" red="0.25490197539329529" green="0.63529413938522339" blue="0.87058824300765991" alpha="1" colorSpace="calibratedRGB"/>
</shadow>
@@ -764,7 +771,8 @@
</userDefinedRuntimeAttributes>
</customView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Q8N-1B-PXN">
<rect key="frame" x="343" y="59" width="41" height="17"/>
<rect key="frame" x="289" y="59" width="41" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="inline" title="More" bezelStyle="inline" alignment="center" controlSize="small" borderStyle="border" inset="2" id="Z8O-Rd-zkL">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystemBold"/>
@@ -773,6 +781,21 @@
<segue destination="DYk-pp-mvu" kind="popover" popoverAnchorView="Q8N-1B-PXN" popoverBehavior="t" preferredEdge="maxY" id="4W2-kM-ewl"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vs0-Bp-9Zv">
<rect key="frame" x="422" y="59" width="41" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="inline" title="More" bezelStyle="inline" alignment="center" controlSize="small" borderStyle="border" inset="2" id="zgh-wl-Oer">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystemBold"/>
</buttonCell>
<connections>
<segue destination="yv4-ZL-xud" kind="popover" popoverAnchorView="vs0-Bp-9Zv" popoverBehavior="t" preferredEdge="maxY" id="6Tb-kJ-Lhz"/>
</connections>
</button>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lR0-9k-CEu" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="378" y="84" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
</subviews>
</view>
</viewController>
@@ -781,15 +804,204 @@
<point key="canvasLocation" x="477" y="228"/>
</scene>
<!--In Determinate View Controller-->
<scene sceneID="vp2-ly-Hqp">
<objects>
<viewController id="yv4-ZL-xud" customClass="InDeterminateViewController" customModule="ProgressKit" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="loM-yl-24e">
<rect key="frame" x="0.0" y="0.0" width="324" height="220"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="kmw-BV-WIW" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="14" y="126" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="strokeWidth">
<real key="value" value="9"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.78039216995239258" green="0.24705882370471954" blue="0.0078431377187371254" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BN1-ct-TGA" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="215" y="126" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="arcLength">
<integer key="value" value="75"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="40"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IUA-cq-CIL" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="31" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="clockWise" value="NO"/>
<userDefinedRuntimeAttribute type="number" keyPath="arcLength">
<integer key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hgU-aF-axh" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="113" y="126" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.1647058874" green="0.65882354970000001" blue="0.53333336109999996" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.90106928350000004" green="0.30634868139999999" blue="0.1696610898" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="strokeWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qTF-Fa-o4i" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="31" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.0" green="0.23137255012989044" blue="0.51372551918029785" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="clockWise" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="arcLength">
<integer key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gqN-0P-V6h" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="128" y="30" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.0" green="0.23137255012989044" blue="0.51372551918029785" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.47450980544090271" green="0.23529411852359772" blue="0.46666666865348816" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="swG-XB-dD9" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="121" y="23" width="95" height="95"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.0" green="0.23137255009999999" blue="0.51372551919999998" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.47450980539999998" green="0.23529411850000001" blue="0.46666666870000001" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="strokeWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="8WU-rT-wd5" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="138" y="40" width="60" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.0" green="0.23137255009999999" blue="0.51372551919999998" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.47450980539999998" green="0.23529411850000001" blue="0.46666666870000001" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="strokeWidth">
<real key="value" value="3"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bfz-P2-8sn" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="224" y="30" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.47450980544090271" green="0.23529411852359772" blue="0.46666666865348816" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.88627451658248901" green="0.40392157435417175" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="strokeWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="arcLength">
<integer key="value" value="47"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="j2W-FJ-v1G" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="229" y="35" width="70" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.47450980539999998" green="0.23529411850000001" blue="0.46666666870000001" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.88627451660000001" green="0.40392157439999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="strokeWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bgf-hY-ZRh" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="234" y="40" width="60" height="60"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.47450980539999998" green="0.23529411850000001" blue="0.46666666870000001" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.88627451660000001" green="0.40392157439999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="strokeWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="arcLength">
<integer key="value" value="22"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="RtF-Gh-lRq" customClass="RotatingArc" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="239" y="45" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.47450980539999998" green="0.23529411850000001" blue="0.46666666870000001" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.88627451660000001" green="0.40392157439999998" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="strokeWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="arcLength">
<integer key="value" value="11"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
</subviews>
</view>
</viewController>
<customObject id="Aep-y6-iJb" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1053" y="221"/>
</scene>
<!--In Determinate View Controller-->
<scene sceneID="A7n-21-b2E">
<objects>
<viewController id="Y7I-2Q-c7j" customClass="InDeterminateViewController" customModule="ProgressKit" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="tpW-6T-RtR">
<rect key="frame" x="0.0" y="0.0" width="450" height="115"/>
<rect key="frame" x="0.0" y="0.0" width="450" height="180"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Qkh-Jc-Yju" customClass="CircularSnail" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="15" width="80" height="80"/>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Qkh-Jc-Yju" customClass="MaterialProgress" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="80" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.93725490570068359" green="0.92941176891326904" blue="0.92156863212585449" alpha="0.0" colorSpace="calibratedRGB"/>
@@ -799,8 +1011,9 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lq1-2r-OsR" customClass="CircularSnail" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="235" y="15" width="80" height="80"/>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lq1-2r-OsR" customClass="MaterialProgress" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="235" y="80" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.13725490868091583" green="0.49019607901573181" blue="0.81568628549575806" alpha="0.57000000000000006" colorSpace="calibratedRGB"/>
@@ -816,8 +1029,9 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zv2-cL-kGS" customClass="CircularSnail" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="370" y="37" width="40" height="40"/>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zv2-cL-kGS" customClass="MaterialProgress" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="370" y="102" width="40" height="40"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.13725490868091583" green="0.49019607901573181" blue="0.81568628549575806" alpha="0.0" colorSpace="calibratedRGB"/>
@@ -830,20 +1044,35 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BCf-PU-fcx" customClass="CircularSnail" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="123" y="15" width="80" height="80"/>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BCf-PU-fcx" customClass="MaterialProgress" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="123" y="80" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="40"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Rp1-na-hhA" customClass="Rainbow" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="0.0" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Gyx-mO-3Yh" customClass="Rainbow" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="123" y="0.0" width="80" height="80"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="onLightOffDark" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="lineWidth">
<real key="value" value="6"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
</subviews>
</view>
</viewController>
<customObject id="qek-pA-X3K" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="804" y="492.5"/>
<point key="canvasLocation" x="804" y="525"/>
</scene>
<!--Determinate View Controller-->
<scene sceneID="hIz-AP-VOD">
@@ -855,6 +1084,7 @@
<subviews>
<slider verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vwx-DU-bI3">
<rect key="frame" x="136" y="264" width="289" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<sliderCell key="cell" continuous="YES" state="on" alignment="left" maxValue="1" doubleValue="0.29999999999999999" tickMarkPosition="above" sliderType="linear" id="kV7-A8-t5m"/>
<connections>
<action selector="sliderDragged:" target="XfG-lQ-9wD" id="mes-ql-pK5"/>
@@ -862,6 +1092,7 @@
</slider>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="p9y-Jj-cPs">
<rect key="frame" x="18" y="266" width="106" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Live Progress" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="Pp0-aX-cfK">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
@@ -872,6 +1103,7 @@
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0tx-N3-gG1">
<rect key="frame" x="437" y="265" width="45" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="100 %" id="7Nr-gz-yTj">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -883,6 +1115,7 @@
</textField>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fRz-hN-yoj" customClass="ProgressBar" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="26" y="45" width="454" height="9"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="foreground">
<color key="value" red="0.29411765933036804" green="0.22352941334247589" blue="0.5372549295425415" alpha="1" colorSpace="calibratedRGB"/>
@@ -897,6 +1130,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ejA-gs-jO8" customClass="ProgressBar" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="26" y="91" width="454" height="15"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="progress">
<real key="value" value="0.34999999999999998"/>
@@ -905,6 +1139,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dYN-D7-hBy" customClass="CircularProgressView" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="26" y="132" width="101" height="101"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="progress">
<real key="value" value="0.40999999999999998"/>
@@ -913,6 +1148,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="S81-p1-vGt" customClass="CircularProgressView" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="171" y="150" width="64" height="64"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.83921569585800171" green="0.44705882668495178" blue="0.43921568989753723" alpha="1" colorSpace="calibratedRGB"/>
@@ -930,6 +1166,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Bbh-Em-IM9" customClass="CircularProgressView" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="265" y="132" width="101" height="101"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" white="1" alpha="0.0" colorSpace="calibratedWhite"/>
@@ -948,6 +1185,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4q2-PV-rE0" customClass="ProgressBar" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="26" y="67" width="454" height="11"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="progress">
<real key="value" value="0.80000000000000004"/>
@@ -983,6 +1221,7 @@
<subviews>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="X2k-vb-sC9" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="20" y="122" width="56" height="56"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="7" height="7"/>
@@ -994,6 +1233,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EOH-IG-9v8" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="103" y="117" width="67" height="67"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="3" height="13"/>
@@ -1009,6 +1249,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xbE-4t-MsT" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="198" y="98" width="87" height="87"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="8" height="8"/>
@@ -1026,6 +1267,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4re-h9-0B8" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="324" y="98" width="87" height="87"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="8" height="8"/>
@@ -1044,6 +1286,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cxV-XU-BMs" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="324" y="98" width="87" height="87"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="8" height="8"/>
@@ -1062,6 +1305,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LQW-TQ-ZTf" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="198" y="13" width="87" height="87"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="8" height="8"/>
@@ -1083,6 +1327,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qCX-xw-cn0" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="198" y="13" width="87" height="87"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="7" height="7"/>
@@ -1104,9 +1349,11 @@
</customView>
<progressIndicator horizontalHuggingPriority="750" verticalHuggingPriority="750" fixedFrame="YES" maxValue="100" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="rV6-J2-9Jn">
<rect key="frame" x="20" y="48" width="16" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</progressIndicator>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="M0A-06-Wvu" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="103" y="23" width="67" height="67"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="9" height="6"/>
@@ -1128,6 +1375,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cRc-hQ-H17" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="339" y="28" width="56" height="56"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="7" height="7"/>
@@ -1142,6 +1390,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sop-qz-vfQ" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="58" y="48" width="18" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="2" height="4"/>
@@ -1178,6 +1427,7 @@
<subviews>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4ZV-ge-io4" customClass="Crawler" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="12" y="17" width="70" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.96470588445663452" green="0.48627451062202454" blue="0.0" alpha="0.0" colorSpace="calibratedRGB"/>
@@ -1189,6 +1439,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="mje-ex-whw" customClass="Crawler" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="105" y="17" width="70" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="35"/>
@@ -1197,6 +1448,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="C1d-xS-5EM" customClass="Crawler" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="193" y="17" width="70" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.76862746477127075" green="0.25882354378700256" blue="0.27058824896812439" alpha="1" colorSpace="calibratedRGB"/>
@@ -1208,6 +1460,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5mj-vA-VO1" customClass="Crawler" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="284" y="17" width="70" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" white="0.1178155164969595" alpha="0.65000000000000002" colorSpace="calibratedWhite"/>
@@ -1219,6 +1472,7 @@
</customView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="GLF-fC-Weh" customClass="Crawler" customModule="ProgressKit" customModuleProvider="target">
<rect key="frame" x="369" y="17" width="70" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.46666666865348816" green="0.7137255072593689" blue="0.94901961088180542" alpha="1" colorSpace="calibratedRGB"/>
+4 -4
View File
@@ -19,11 +19,11 @@ class DeterminateViewController: NSViewController {
@IBOutlet weak var slider: NSSlider!
@IBAction func sliderDragged(sender: NSSlider) {
@IBAction func sliderDragged(_ sender: NSSlider) {
let event = NSApplication.sharedApplication().currentEvent
let event = NSApplication.shared().currentEvent
// let dragStart = event!.type == NSEventType.LeftMouseDown
let dragEnd = event!.type == NSEventType.LeftMouseUp
let dragEnd = event!.type == NSEventType.leftMouseUp
// let dragging = event!.type == NSEventType.LeftMouseDragged
if liveProgress || dragEnd {
@@ -32,7 +32,7 @@ class DeterminateViewController: NSViewController {
labelPercentage = "\(Int(sender.floatValue * 100))%"
}
func setProgress(progress: CGFloat) {
func setProgress(_ progress: CGFloat) {
for view in self.view.subviews {
if view is DeterminateAnimation {
(view as! DeterminateAnimation).progress = progress
+2 -6
View File
@@ -13,17 +13,13 @@ class InDeterminateViewController: NSViewController {
override func viewDidAppear() {
for view in self.view.subviews {
if view is IndeterminateAnimation {
(view as! IndeterminateAnimation).animate = true
}
(view as? IndeterminateAnimation)?.animate = true
}
}
override func viewWillDisappear() {
for view in self.view.subviews {
if view is IndeterminateAnimation {
(view as! IndeterminateAnimation).animate = false
}
(view as? IndeterminateAnimation)?.animate = false
}
}
}
+1 -1
View File
@@ -28,7 +28,7 @@ class ProgressKitTests: XCTestCase {
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
self.measure() {
// Put the code you want to measure the time of here.
}
}
+28 -26
View File
@@ -11,43 +11,45 @@ import AppKit
extension NSRect {
var mid: CGPoint {
return CGPoint(x: CGRectGetMidX(self), y: CGRectGetMidY(self))
return CGPoint(x: self.midX, y: self.midY)
}
}
extension NSBezierPath {
/// Converts NSBezierPath to CGPath
var CGPath: CGPathRef {
let path = CGPathCreateMutable()
let points = UnsafeMutablePointer<NSPoint>.alloc(3)
var CGPath: CGPath {
let path = CGMutablePath()
let points = UnsafeMutablePointer<NSPoint>.allocate(capacity: 3)
let numElements = self.elementCount
if numElements > 0 {
var didClosePath = true
for index in 0..<numElements {
let pathType = self.elementAtIndex(index, associatedPoints: points)
switch pathType {
case .MoveToBezierPathElement:
CGPathMoveToPoint(path, nil, points[0].x, points[0].y)
case .LineToBezierPathElement:
CGPathAddLineToPoint(path, nil, points[0].x, points[0].y)
didClosePath = false
case .CurveToBezierPathElement:
CGPathAddCurveToPoint(path, nil, points[0].x, points[0].y, points[1].x, points[1].y, points[2].x, points[2].y)
didClosePath = false
case .ClosePathBezierPathElement:
CGPathCloseSubpath(path)
didClosePath = true
}
for index in 0..<numElements {
let pathType = self.element(at: index, associatedPoints: points)
switch pathType {
case .moveToBezierPathElement:
path.move(to: points[0])
case .lineToBezierPathElement:
path.addLine(to: points[0])
case .curveToBezierPathElement:
path.addCurve(to: points[2], control1: points[0], control2: points[1])
case .closePathBezierPathElement:
path.closeSubpath()
}
if !didClosePath { CGPathCloseSubpath(path) }
}
points.dealloc(3)
points.deallocate(capacity: 3)
return path
}
}
/// All the do_ invocations will be replace by do after Swift 2.0
func do_ (@noescape work: () -> ()) {
work()
func degreeToRadian(_ degree: Int) -> Double {
return Double(degree) * (M_PI / 180)
}
func radianToDegree(_ radian: Double) -> Int {
return Int(radian * (180 / M_PI))
}
func + (p1: CGPoint, p2: CGPoint) -> CGPoint {
return CGPoint(x: p1.x + p2.x, y: p1.y + p2.y)
}
+30 -8
View File
@@ -1,16 +1,25 @@
![Image](/Images/banner.gif)
![ProgressKit Banner](/Images/banner.gif)
[![Cocoapods Compatible](https://img.shields.io/cocoapods/v/ProgressKit.svg)](https://img.shields.io/cocoapods/v/ProgressKit.svg)
[![Platform](https://img.shields.io/cocoapods/p/ProgressKit.svg?style=flat)](http://cocoadocs.org/docsets/ProgressKit)
[![License](https://img.shields.io/cocoapods/l/ProgressKit.svg?style=flat)](http://cocoadocs.org/docsets/ProgressKit)
`ProgressKit` has set of cool `IBDesignable` progress views, with huge customisation options.
You can now make spinners, progress bar, crawlers etc, which nicely gets integrated according to your app theme.
You can now make spinners, progress bar, crawlers etc, which can be finely customised according to your app palette.
# Contents
- [Installation](#installation)
- [Usage](#usage)
- [Indeterminate Progress](#indeterminate-progress)
- [CircularSnail](#circularsnail)
- [MaterialProgress](#MaterialProgress)
- [Rainbow](#rainbow)
- [Crawler](#crawler)
- [Spinner](#spinner)
- [Shooting Stars](#shooting-stars)
- [Rotating Arc](#rotating-arc)
- [Determinate Progress](#determinate-progress)
- [Circular Progress] (#circular-progress)
- [Progress Bar](#progress-bar)
@@ -18,7 +27,7 @@ You can now make spinners, progress bar, crawlers etc, which nicely gets integra
# Installation
##CocoaPods
[CocoaPods 0.36](http://cocoapods.org) adds supports for Swift and embedded frameworks.
[CocoaPods](http://cocoapods.org) adds supports for Swift and embedded frameworks.
To integrate ProgressKit into your Xcode project using CocoaPods, specify it in your `Podfile`:
@@ -27,6 +36,11 @@ use_frameworks!
pod 'ProgressKit'
```
For Swift 3 install directly from `swift-3` branch form github
```ruby
pod 'ProgressKit', :git => "https://github.com/kaunteya/ProgressKit.git", :branch => 'swift-3'
```
Then, run the following command:
@@ -40,7 +54,7 @@ $ pod install
- Set the size such that width and height are equal
- Drag `IBOutlet` to View Controller
- For `Indeterminate` Progress Views
- Set `Boolean` value to `view.animate`
- Set `true / false` to `view.animate`
- For `Determinate` Progress Views:
- Set `view.progress` to value in `0...1`
@@ -50,19 +64,27 @@ $ pod install
![Indeterminate](/Images/indeterminate.gif)
Progress indicators which animate indefinately are `Indeterminate Progress` Views.
This are the InDeterminate Progress Indicators.
This are the set of Indeterminate Progress Indicators.
## CircularSnail
## MaterialProgress
![CircularSnail](/Images/CircularSnail.gif)
## Rainbow
![Rainbow](/Images/Rainbow.gif)
## Crawler
![Crawler](/Images/Crawler.gif)
## Spinner
![Spinner](/Images/Spinner.gif)
## Shooting Stars
![Shooting Stars](/Images/ShootingStars.gif)
## Rotating Arc
![Rotating Arc](/Images/RotatingArc.gif)
# Determinate Progress
Determinate progress views can be used for tasks whos progress can be seen and determined gradually.
Determinate progress views can be used for tasks whos progress can be seen and determined.
## Circular Progress
![Circular Progress](/Images/CircularProgress.png)