Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37b7e3a3b7 | |||
| d5ae9526be | |||
| 5ba59404e8 | |||
| 325b0d7602 | |||
| 1a574d7024 | |||
| b986faf947 | |||
| ac97b80638 | |||
| fca07a4fbd | |||
| 643ac6ee2c | |||
| 68b340a337 | |||
| ca6e644069 | |||
| cdb141f3a5 | |||
| 1d8f558e20 | |||
| bde87514fc | |||
| 42e369284b | |||
| c2c30f62a1 | |||
| 51ba0fc1e9 | |||
| 0b5d70f63a | |||
| 69676b77c6 |
@@ -1,3 +1,4 @@
|
||||
.DS_Store
|
||||
# Xcode
|
||||
#
|
||||
build/
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3.0
|
||||
+5
-5
@@ -9,7 +9,7 @@
|
||||
import AppKit
|
||||
|
||||
@IBDesignable
|
||||
public class BaseView : NSView {
|
||||
open class BaseView : NSView {
|
||||
|
||||
override public init(frame frameRect: NSRect) {
|
||||
super.init(frame: frameRect)
|
||||
@@ -27,19 +27,19 @@ public class BaseView : NSView {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
|
||||
@IBInspectable public 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 public 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 public 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
open var backgroundCircle = CAShapeLayer()
|
||||
open var progressLayer = CAShapeLayer()
|
||||
open var percentLabelLayer = CATextLayer()
|
||||
|
||||
@IBInspectable public var strokeWidth: CGFloat = -1 {
|
||||
@IBInspectable open var strokeWidth: CGFloat = -1 {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable public 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() {
|
||||
@@ -65,10 +65,10 @@ public class CircularProgressView: DeterminateAnimation {
|
||||
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)
|
||||
}
|
||||
@@ -76,15 +76,15 @@ public class CircularProgressView: DeterminateAnimation {
|
||||
// Progress Layer
|
||||
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)
|
||||
}
|
||||
@@ -92,9 +92,9 @@ public class CircularProgressView: DeterminateAnimation {
|
||||
// Percentage Layer
|
||||
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
|
||||
|
||||
@@ -14,12 +14,12 @@ protocol DeterminableAnimation {
|
||||
}
|
||||
|
||||
@IBDesignable
|
||||
public class DeterminateAnimation: BaseView, DeterminableAnimation {
|
||||
open class DeterminateAnimation: BaseView, DeterminableAnimation {
|
||||
|
||||
@IBInspectable public var animated: Bool = true
|
||||
@IBInspectable open var animated: Bool = true
|
||||
|
||||
/// Value of progress now. Range 0..1
|
||||
@IBInspectable public var progress: CGFloat = 0 {
|
||||
@IBInspectable open var progress: CGFloat = 0 {
|
||||
didSet {
|
||||
updateProgress()
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@ import Foundation
|
||||
import Cocoa
|
||||
|
||||
@IBDesignable
|
||||
public class ProgressBar: DeterminateAnimation {
|
||||
open class ProgressBar: DeterminateAnimation {
|
||||
|
||||
var borderLayer = CAShapeLayer()
|
||||
var progressLayer = CAShapeLayer()
|
||||
open var borderLayer = CAShapeLayer()
|
||||
open var progressLayer = CAShapeLayer()
|
||||
|
||||
@IBInspectable public 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)
|
||||
|
||||
}
|
||||
|
||||
@@ -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,9 +27,10 @@ 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
|
||||
@@ -38,7 +39,7 @@ public class Crawler: IndeterminateAnimation {
|
||||
for i in 0 ..< 5 {
|
||||
let starShape = CAShapeLayer()
|
||||
starList.append(starShape)
|
||||
starShape.backgroundColor = foreground.CGColor
|
||||
starShape.backgroundColor = foreground.cgColor
|
||||
|
||||
let circleWidth = smallCircleSize - Double(i) * 2
|
||||
starShape.bounds = CGRect(x: 0, y: 0, width: circleWidth, height: circleWidth)
|
||||
@@ -47,7 +48,7 @@ public class Crawler: IndeterminateAnimation {
|
||||
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
|
||||
@@ -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: "")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,33 +6,32 @@
|
||||
// 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 {
|
||||
open class IndeterminateAnimation: BaseView, AnimationStatusDelegate {
|
||||
|
||||
/// View is hidden when *animate* property is false
|
||||
@IBInspectable public var displayAfterAnimationEnds: Bool = 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
|
||||
*/
|
||||
public var animate: Bool = false {
|
||||
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()
|
||||
}
|
||||
|
||||
@@ -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 public 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")
|
||||
}
|
||||
let π2 = Double.pi * 2
|
||||
|
||||
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")
|
||||
}
|
||||
}
|
||||
@@ -10,29 +10,29 @@ import Foundation
|
||||
import Cocoa
|
||||
|
||||
@IBDesignable
|
||||
public class Rainbow: CircularSnail {
|
||||
open class Rainbow: MaterialProgress {
|
||||
|
||||
@IBInspectable public 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)
|
||||
}
|
||||
|
||||
|
||||
@@ -12,24 +12,24 @@ import Cocoa
|
||||
private let duration = 0.25
|
||||
|
||||
@IBDesignable
|
||||
public class RotatingArc: IndeterminateAnimation {
|
||||
open class RotatingArc: IndeterminateAnimation {
|
||||
|
||||
var backgroundCircle = CAShapeLayer()
|
||||
var arcLayer = CAShapeLayer()
|
||||
|
||||
@IBInspectable public var strokeWidth: CGFloat = 5 {
|
||||
@IBInspectable open var strokeWidth: CGFloat = 5 {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable public var arcLength: Int = 35 {
|
||||
@IBInspectable open var arcLength: Int = 35 {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable public var clockWise: Bool = true {
|
||||
@IBInspectable open var clockWise: Bool = true {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class RotatingArc: IndeterminateAnimation {
|
||||
tempRotation.repeatCount = Float.infinity
|
||||
tempRotation.fromValue = 0
|
||||
tempRotation.toValue = 1
|
||||
tempRotation.cumulative = true
|
||||
tempRotation.isCumulative = true
|
||||
tempRotation.duration = duration
|
||||
return tempRotation
|
||||
}()
|
||||
@@ -52,8 +52,8 @@ public class RotatingArc: IndeterminateAnimation {
|
||||
override func notifyViewRedesigned() {
|
||||
super.notifyViewRedesigned()
|
||||
|
||||
arcLayer.strokeColor = foreground.CGColor
|
||||
backgroundCircle.strokeColor = foreground.colorWithAlphaComponent(0.4).CGColor
|
||||
arcLayer.strokeColor = foreground.cgColor
|
||||
backgroundCircle.strokeColor = foreground.withAlphaComponent(0.4).cgColor
|
||||
|
||||
backgroundCircle.lineWidth = self.strokeWidth
|
||||
arcLayer.lineWidth = strokeWidth
|
||||
@@ -61,7 +61,7 @@ public class RotatingArc: IndeterminateAnimation {
|
||||
|
||||
let arcPath = NSBezierPath()
|
||||
let endAngle: CGFloat = CGFloat(-360) * CGFloat(arcLength) / 100
|
||||
arcPath.appendBezierPathWithArcWithCenter(self.bounds.mid, radius: radius, startAngle: 0, endAngle: endAngle, clockwise: true)
|
||||
arcPath.appendArc(withCenter: self.bounds.mid, radius: radius, startAngle: 0, endAngle: endAngle, clockwise: true)
|
||||
|
||||
arcLayer.path = arcPath.CGPath
|
||||
}
|
||||
@@ -75,27 +75,27 @@ public class RotatingArc: IndeterminateAnimation {
|
||||
backgroundCircle.frame = rect
|
||||
backgroundCircle.lineWidth = strokeWidth
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
// Arc Layer
|
||||
do {
|
||||
arcLayer.fillColor = NSColor.clearColor().CGColor
|
||||
arcLayer.fillColor = NSColor.clear.cgColor
|
||||
arcLayer.lineWidth = strokeWidth
|
||||
|
||||
arcLayer.frame = rect
|
||||
arcLayer.strokeColor = foreground.CGColor
|
||||
arcLayer.strokeColor = foreground.cgColor
|
||||
self.layer?.addSublayer(arcLayer)
|
||||
}
|
||||
}
|
||||
|
||||
override func startAnimation() {
|
||||
arcLayer.addAnimation(rotationAnimation, forKey: "")
|
||||
arcLayer.add(rotationAnimation, forKey: "")
|
||||
}
|
||||
|
||||
override func stopAnimation() {
|
||||
|
||||
@@ -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() {
|
||||
@@ -37,12 +37,12 @@ public class ShootingStars: IndeterminateAnimation {
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class ShootingStars: IndeterminateAnimation {
|
||||
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")
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -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 public var starSize:CGSize = CGSize(width: 6, height: 15) {
|
||||
@IBInspectable open var starSize:CGSize = CGSize(width: 6, height: 15) {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable public var roundedCorners: Bool = true {
|
||||
@IBInspectable open var roundedCorners: Bool = true {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@IBInspectable public var distance: CGFloat = CGFloat(20) {
|
||||
@IBInspectable open var distance: CGFloat = CGFloat(20) {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable public var starCount: Int = 10 {
|
||||
@IBInspectable open var starCount: Int = 10 {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable public var duration: Double = 1 {
|
||||
@IBInspectable open var duration: Double = 1 {
|
||||
didSet {
|
||||
animation.duration = duration
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable public var clockwise: Bool = false {
|
||||
@IBInspectable open var clockwise: Bool = false {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
@@ -72,12 +72,12 @@ public class Spinner: IndeterminateAnimation {
|
||||
|
||||
override func notifyViewRedesigned() {
|
||||
super.notifyViewRedesigned()
|
||||
starList.removeAll(keepCapacity: true)
|
||||
starList.removeAll(keepingCapacity: true)
|
||||
containerLayer.sublayers = nil
|
||||
animation.values = [Double]()
|
||||
var i = 0.0
|
||||
while i < 360 {
|
||||
var iRadian = CGFloat(i * M_PI / 180.0)
|
||||
var iRadian = CGFloat(i * Double.pi / 180.0)
|
||||
if clockwise { iRadian = -iRadian }
|
||||
|
||||
animation.values?.append(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);
|
||||
@@ -105,7 +105,7 @@ public class Spinner: IndeterminateAnimation {
|
||||
}
|
||||
|
||||
override func startAnimation() {
|
||||
containerLayer.addAnimation(animation, forKey: "rotation")
|
||||
containerLayer.add(animation, forKey: "rotation")
|
||||
}
|
||||
|
||||
override func stopAnimation() {
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'ProgressKit'
|
||||
spec.version = '0.4.1'
|
||||
spec.version = '0.7'
|
||||
spec.license = 'MIT'
|
||||
spec.summary = 'Animated ProgressViews for OS X'
|
||||
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 }
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
E31617A61BC0596C007AD70F /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E31617A51BC0596C007AD70F /* BaseView.swift */; };
|
||||
E340FDB81BDE45F000CE6550 /* RotatingArc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E340FDB71BDE45F000CE6550 /* RotatingArc.swift */; settings = {ASSET_TAGS = (); }; };
|
||||
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 */; };
|
||||
@@ -23,7 +23,6 @@
|
||||
E3AD65DF1B426758009541CD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E3AD65DD1B426758009541CD /* Main.storyboard */; };
|
||||
E3AD65EB1B426758009541CD /* ProgressKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3AD65EA1B426758009541CD /* ProgressKitTests.swift */; };
|
||||
E3AD65F71B427511009541CD /* InDeterminateVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3AD65F61B427511009541CD /* InDeterminateVC.swift */; };
|
||||
E3CCD5981BBC19ED00F7DB9A /* ProgressKit.podspec in Resources */ = {isa = PBXBuildFile; fileRef = E3CCD5971BBC19ED00F7DB9A /* ProgressKit.podspec */; };
|
||||
E3CCD59A1BBC2B9B00F7DB9A /* ProgressUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3CCD5991BBC2B9B00F7DB9A /* ProgressUtils.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@@ -38,12 +37,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>"; };
|
||||
@@ -84,7 +85,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E3918F8C1B4E8AB100558DAB /* IndeterminateAnimation.swift */,
|
||||
E3918F821B4E88DE00558DAB /* CircularSnail.swift */,
|
||||
E3918F821B4E88DE00558DAB /* MaterialProgress.swift */,
|
||||
E3918FA71B4ECF7100558DAB /* Rainbow.swift */,
|
||||
E3A468511B5434F7006DDE31 /* Crawler.swift */,
|
||||
E3918F831B4E88DE00558DAB /* ShootingStars.swift */,
|
||||
@@ -140,6 +141,8 @@
|
||||
E3AD65D51B426758009541CD /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E310B1D21D7AB2D4008DEF62 /* README.md */,
|
||||
E310B1D41D7AB2EA008DEF62 /* LICENSE */,
|
||||
E3CCD5991BBC2B9B00F7DB9A /* ProgressUtils.swift */,
|
||||
E3CCD5971BBC19ED00F7DB9A /* ProgressKit.podspec */,
|
||||
E3AD65D61B426758009541CD /* Info.plist */,
|
||||
@@ -210,14 +213,16 @@
|
||||
attributes = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0700;
|
||||
LastUpgradeCheck = 0920;
|
||||
ORGANIZATIONNAME = "Kauntey Suryawanshi";
|
||||
TargetAttributes = {
|
||||
E3AD65D11B426758009541CD = {
|
||||
CreatedOnToolsVersion = 6.3.2;
|
||||
LastSwiftMigration = 0920;
|
||||
};
|
||||
E3AD65E31B426758009541CD = {
|
||||
CreatedOnToolsVersion = 6.3.2;
|
||||
LastSwiftMigration = 0920;
|
||||
TestTargetID = E3AD65D11B426758009541CD;
|
||||
};
|
||||
};
|
||||
@@ -246,7 +251,6 @@
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E3CCD5981BBC19ED00F7DB9A /* ProgressKit.podspec in Resources */,
|
||||
E3AD65DF1B426758009541CD /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -272,7 +276,7 @@
|
||||
E3918F851B4E88DE00558DAB /* ShootingStars.swift in Sources */,
|
||||
E3918F811B4E88CF00558DAB /* CircularProgressView.swift 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 */,
|
||||
@@ -321,13 +325,21 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
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_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
@@ -366,13 +378,21 @@
|
||||
CLANG_CXX_LIBRARY = "libc++";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
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_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "-";
|
||||
@@ -391,6 +411,7 @@
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.10;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -403,6 +424,8 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -415,6 +438,8 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
@@ -435,6 +460,8 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit";
|
||||
};
|
||||
name = Debug;
|
||||
@@ -452,6 +479,8 @@
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = On;
|
||||
SWIFT_VERSION = 4.0;
|
||||
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit";
|
||||
};
|
||||
name = Release;
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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="10117" systemVersion="15G31" 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="10117"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11198.2"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Application-->
|
||||
@@ -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"/>
|
||||
@@ -709,6 +711,7 @@
|
||||
</button>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3VR-oT-y2I" customClass="Spinner" customModule="ProgressKit" customModuleProvider="target">
|
||||
<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"/>
|
||||
@@ -721,12 +724,14 @@
|
||||
</customView>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="haM-Vg-aIY" customClass="Crawler" customModule="ProgressKit" customModuleProvider="target">
|
||||
<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="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>
|
||||
@@ -765,6 +772,7 @@
|
||||
</customView>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Q8N-1B-PXN">
|
||||
<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"/>
|
||||
@@ -775,6 +783,7 @@
|
||||
</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"/>
|
||||
@@ -785,6 +794,7 @@
|
||||
</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>
|
||||
@@ -803,6 +813,7 @@
|
||||
<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"/>
|
||||
@@ -814,6 +825,7 @@
|
||||
</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"/>
|
||||
@@ -825,6 +837,7 @@
|
||||
</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">
|
||||
@@ -834,6 +847,7 @@
|
||||
</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"/>
|
||||
@@ -848,6 +862,7 @@
|
||||
</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"/>
|
||||
@@ -860,6 +875,7 @@
|
||||
</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"/>
|
||||
@@ -871,6 +887,7 @@
|
||||
</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"/>
|
||||
@@ -885,6 +902,7 @@
|
||||
</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"/>
|
||||
@@ -899,6 +917,7 @@
|
||||
</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"/>
|
||||
@@ -916,6 +935,7 @@
|
||||
</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"/>
|
||||
@@ -930,6 +950,7 @@
|
||||
</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"/>
|
||||
@@ -947,6 +968,7 @@
|
||||
</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"/>
|
||||
@@ -977,8 +999,9 @@
|
||||
<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">
|
||||
<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"/>
|
||||
@@ -988,8 +1011,9 @@
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</customView>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lq1-2r-OsR" customClass="CircularSnail" customModule="ProgressKit" customModuleProvider="target">
|
||||
<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"/>
|
||||
@@ -1005,8 +1029,9 @@
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</customView>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Zv2-cL-kGS" customClass="CircularSnail" customModule="ProgressKit" customModuleProvider="target">
|
||||
<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"/>
|
||||
@@ -1019,8 +1044,9 @@
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</customView>
|
||||
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BCf-PU-fcx" customClass="CircularSnail" customModule="ProgressKit" customModuleProvider="target">
|
||||
<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"/>
|
||||
@@ -1029,9 +1055,11 @@
|
||||
</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">
|
||||
@@ -1056,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"/>
|
||||
@@ -1063,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"/>
|
||||
@@ -1073,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"/>
|
||||
@@ -1084,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"/>
|
||||
@@ -1098,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"/>
|
||||
@@ -1106,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"/>
|
||||
@@ -1114,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"/>
|
||||
@@ -1131,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"/>
|
||||
@@ -1149,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"/>
|
||||
@@ -1184,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"/>
|
||||
@@ -1195,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"/>
|
||||
@@ -1210,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"/>
|
||||
@@ -1227,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"/>
|
||||
@@ -1245,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"/>
|
||||
@@ -1263,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"/>
|
||||
@@ -1284,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"/>
|
||||
@@ -1305,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"/>
|
||||
@@ -1329,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"/>
|
||||
@@ -1343,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"/>
|
||||
@@ -1379,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"/>
|
||||
@@ -1390,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"/>
|
||||
@@ -1398,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"/>
|
||||
@@ -1409,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"/>
|
||||
@@ -1420,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"/>
|
||||
|
||||
@@ -10,8 +10,8 @@ import Cocoa
|
||||
|
||||
class DeterminateViewController: NSViewController {
|
||||
|
||||
dynamic var liveProgress: Bool = true
|
||||
dynamic var labelPercentage: String = "30%"
|
||||
@objc dynamic var liveProgress: Bool = true
|
||||
@objc dynamic var labelPercentage: String = "30%"
|
||||
|
||||
override func viewDidLoad() {
|
||||
preferredContentSize = NSMakeSize(500, 300)
|
||||
@@ -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 == NSEvent.EventType.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
|
||||
|
||||
@@ -28,9 +28,6 @@ class ProgressKitTests: XCTestCase {
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measureBlock() {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+18
-18
@@ -11,42 +11,42 @@ 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
|
||||
|
||||
for index in 0..<numElements {
|
||||
let pathType = self.elementAtIndex(index, associatedPoints: points)
|
||||
let pathType = self.element(at: 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)
|
||||
case .CurveToBezierPathElement:
|
||||
CGPathAddCurveToPoint(path, nil, points[0].x, points[0].y, points[1].x, points[1].y, points[2].x, points[2].y)
|
||||
case .ClosePathBezierPathElement:
|
||||
CGPathCloseSubpath(path)
|
||||
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()
|
||||
}
|
||||
}
|
||||
|
||||
points.dealloc(3)
|
||||
points.deallocate(capacity: 3)
|
||||
return path
|
||||
}
|
||||
}
|
||||
|
||||
func degreeToRadian(degree: Int) -> Double {
|
||||
return Double(degree) * (M_PI / 180)
|
||||
func degreeToRadian(_ degree: Int) -> Double {
|
||||
return Double(degree) * (Double.pi / 180)
|
||||
}
|
||||
|
||||
func radianToDegree(radian: Double) -> Int {
|
||||
return Int(radian * (180 / M_PI))
|
||||
func radianToDegree(_ radian: Double) -> Int {
|
||||
return Int(radian * (180 / Double.pi))
|
||||
}
|
||||
|
||||
func + (p1: CGPoint, p2: CGPoint) -> CGPoint {
|
||||
|
||||
@@ -14,14 +14,14 @@ You can now make spinners, progress bar, crawlers etc, which can be finely custo
|
||||
- [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)
|
||||
- [Circular Progress](#circular-progress)
|
||||
- [Progress Bar](#progress-bar)
|
||||
- [License](#license)
|
||||
|
||||
@@ -36,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:
|
||||
|
||||
@@ -61,7 +66,7 @@ Progress indicators which animate indefinately are `Indeterminate Progress` View
|
||||
|
||||
This are the set of Indeterminate Progress Indicators.
|
||||
|
||||
## CircularSnail
|
||||
## MaterialProgress
|
||||

|
||||
|
||||
## Rainbow
|
||||
|
||||
Reference in New Issue
Block a user