40 Commits

Author SHA1 Message Date
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
Kaunteya Suryawanshi bd82ddebde Updated the base version to 10.10 2015-10-08 11:40:32 +05:30
Kaunteya Suryawanshi 4e9f5f1a5e Updated the podspec 2015-10-08 11:15:04 +05:30
Kaunteya Suryawanshi 673b9640cf Merge branch 'master' of https://github.com/kaunteya/ProgressKit 2015-10-08 11:08:06 +05:30
Kaunteya Suryawanshi 90fe33531a Swift 2.0 2015-10-08 11:04:16 +05:30
Kaunteya Suryawanshi d20c565ee4 Added tag line 2015-10-06 21:17:48 +05:30
Kaunteya Suryawanshi 3f2a90ea9a Updated formatting 2015-10-06 20:55:21 +05:30
Kaunteya Suryawanshi 9df1f477d2 Added banner.gif 2015-10-06 20:50:40 +05:30
Kaunteya Suryawanshi aa019d3bcb Updated the banner 2015-10-06 20:49:54 +05:30
Kaunteya Suryawanshi 18582bd9da Merge branch 'master' of https://github.com/kaunteya/ProgressKit 2015-10-06 20:11:06 +05:30
Kaunteya Suryawanshi 6b44a8a99e Updated the release version 2015-10-06 20:10:45 +05:30
Kaunteya Suryawanshi 10a1b7dcc4 Updated README for Indeterminate Views 2015-10-05 21:00:52 +05:30
Kaunteya Suryawanshi a57242f3eb Added license 2015-10-05 02:23:08 +05:30
26 changed files with 459 additions and 106 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ import AppKit
@IBDesignable
public 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 public 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 public 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 public var cornerRadius: CGFloat = 5.0 {
didSet {
self.notifyViewRedesigned()
}
+8 -8
View File
@@ -16,13 +16,13 @@ public class CircularProgressView: DeterminateAnimation {
var progressLayer = CAShapeLayer()
var percentLabelLayer = CATextLayer()
@IBInspectable var strokeWidth: CGFloat = -1 {
@IBInspectable public var strokeWidth: CGFloat = -1 {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var showPercent: Bool = true {
@IBInspectable public var showPercent: Bool = true {
didSet {
notifyViewRedesigned()
}
@@ -61,20 +61,20 @@ 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
var backgroundPath = NSBezierPath()
let backgroundPath = NSBezierPath()
backgroundPath.appendBezierPathWithArcWithCenter(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.lineCap = kCALineCapRound
@@ -82,15 +82,15 @@ public class CircularProgressView: DeterminateAnimation {
progressLayer.frame = rect
progressLayer.strokeColor = foreground.CGColor
var arcPath = NSBezierPath()
var startAngle = CGFloat(90)
let arcPath = NSBezierPath()
let startAngle = CGFloat(90)
arcPath.appendBezierPathWithArcWithCenter(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.frame = rect
+2 -2
View File
@@ -16,10 +16,10 @@ protocol DeterminableAnimation {
@IBDesignable
public class DeterminateAnimation: BaseView, DeterminableAnimation {
@IBInspectable var animated: Bool = true
@IBInspectable public var animated: Bool = true
/// Value of progress now. Range 0..1
@IBInspectable var progress: CGFloat = 0 {
@IBInspectable public var progress: CGFloat = 0 {
didSet {
updateProgress()
}
+1 -1
View File
@@ -15,7 +15,7 @@ public class ProgressBar: DeterminateAnimation {
var borderLayer = CAShapeLayer()
var progressLayer = CAShapeLayer()
@IBInspectable var borderColor: NSColor = NSColor.blackColor() {
@IBInspectable public var borderColor: NSColor = NSColor.blackColor() {
didSet {
notifyViewRedesigned()
}
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

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 494 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 436 KiB

After

Width:  |  Height:  |  Size: 316 KiB

+4 -4
View File
@@ -15,7 +15,7 @@ private let strokeRange = (start: 0.0, end: 0.8)
@IBDesignable
public class CircularSnail: IndeterminateAnimation {
@IBInspectable var lineWidth: CGFloat = -1 {
@IBInspectable public var lineWidth: CGFloat = -1 {
didSet {
progressLayer.lineWidth = lineWidth
}
@@ -61,7 +61,7 @@ public class CircularSnail: IndeterminateAnimation {
var strokeEndAnimation: CABasicAnimation!
func makeAnimationforKeyPath(keyPath: String) -> CABasicAnimation {
var tempAnimation = CABasicAnimation(keyPath: keyPath)
let tempAnimation = CABasicAnimation(keyPath: keyPath)
tempAnimation.repeatCount = 1
tempAnimation.speed = 2.0
tempAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
@@ -91,7 +91,7 @@ public class CircularSnail: IndeterminateAnimation {
let radius = (rect.width / 2) * 0.75
progressLayer.frame = rect
progressLayer.lineWidth = lineWidth == -1 ? radius / 10: lineWidth
var arcPath = NSBezierPath()
let arcPath = NSBezierPath()
arcPath.appendBezierPathWithArcWithCenter(rect.mid, radius: radius, startAngle: 0, endAngle: 360, clockwise: false)
progressLayer.path = arcPath.CGPath
backgroundRotationLayer.addSublayer(progressLayer)
@@ -99,7 +99,7 @@ public class CircularSnail: IndeterminateAnimation {
var currentRotation = 0.0
let π2 = M_PI * 2
override public func animationDidStop(anim: CAAnimation!, finished flag: Bool) {
override public func animationDidStop(anim: CAAnimation, finished flag: Bool) {
if !animate { return }
CATransaction.begin()
CATransaction.setDisableActions(true)
+8 -8
View File
@@ -35,27 +35,27 @@ public class Crawler: IndeterminateAnimation {
let rect = self.bounds
let insetRect = NSInsetRect(rect, rect.width * 0.15, rect.width * 0.15)
for var i = 0.0; i < 5; i++ {
var starShape = CAShapeLayer()
for i in 0 ..< 5 {
let starShape = CAShapeLayer()
starList.append(starShape)
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)
var arcPath = NSBezierPath()
let arcPath = NSBezierPath()
arcPath.appendBezierPathWithArcWithCenter(insetRect.mid, radius: insetRect.width / 2, startAngle: 90, endAngle: -360 + 90, clockwise: true)
var rotationAnimation = CAKeyframeAnimation(keyPath: "position")
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
var animationGroup = CAAnimationGroup()
let animationGroup = CAAnimationGroup()
animationGroup.animations = [rotationAnimation]
animationGroup.duration = duration
animationGroup.repeatCount = Float.infinity
@@ -65,7 +65,7 @@ public class Crawler: IndeterminateAnimation {
}
override func startAnimation() {
for (index, star) in enumerate(starList) {
for (index, star) in starList.enumerate() {
star.addAnimation(animationGroups[index], forKey: "")
}
}
+22 -3
View File
@@ -15,10 +15,18 @@ protocol AnimationActivityProtocol {
}
public class IndeterminateAnimation: BaseView, AnimationActivityProtocol {
@IBInspectable var displayAfterAnimationEnds: Bool = false
var animate: Bool = false {
/// View is hidden when *animate* property is false
@IBInspectable public 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 {
didSet {
guard animate != oldValue else { return }
if animate {
self.hidden = false
startAnimation()
@@ -30,10 +38,21 @@ public class IndeterminateAnimation: BaseView, AnimationActivityProtocol {
}
}
}
/**
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")
}
}
}
+3 -4
View File
@@ -12,18 +12,17 @@ import Cocoa
@IBDesignable
public class Rainbow: CircularSnail {
@IBInspectable var onLightOffDark: Bool = false
@IBInspectable public var onLightOffDark: Bool = false
override func configureLayers() {
super.configureLayers()
self.background = NSColor.clearColor()
}
override public func animationDidStop(anim: CAAnimation!, finished flag: Bool) {
override public 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
}
+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
public class RotatingArc: IndeterminateAnimation {
var backgroundCircle = CAShapeLayer()
var arcLayer = CAShapeLayer()
@IBInspectable public var strokeWidth: CGFloat = 5 {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable public var arcLength: Int = 35 {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable public 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.cumulative = true
tempRotation.duration = duration
return tempRotation
}()
override func notifyViewRedesigned() {
super.notifyViewRedesigned()
arcLayer.strokeColor = foreground.CGColor
backgroundCircle.strokeColor = foreground.colorWithAlphaComponent(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.appendBezierPathWithArcWithCenter(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.colorWithAlphaComponent(0.5).CGColor
backgroundCircle.fillColor = NSColor.clearColor().CGColor
let backgroundPath = NSBezierPath()
backgroundPath.appendBezierPathWithArcWithCenter(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.lineWidth = strokeWidth
arcLayer.frame = rect
arcLayer.strokeColor = foreground.CGColor
self.layer?.addSublayer(arcLayer)
}
}
override func startAnimation() {
arcLayer.addAnimation(rotationAnimation, forKey: "")
}
override func stopAnimation() {
arcLayer.removeAllAnimations()
}
}
+3 -3
View File
@@ -34,7 +34,7 @@ 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
@@ -47,7 +47,7 @@ public class ShootingStars: IndeterminateAnimation {
}
/// Add default animation
do_ {
do {
animation.fromValue = -dimension
animation.toValue = rect.width * 0.9
animation.duration = animationDuration
@@ -67,7 +67,7 @@ public class ShootingStars: IndeterminateAnimation {
tempAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
}
override public func animationDidStop(anim: CAAnimation!, finished flag: Bool) {
override public func animationDidStop(anim: CAAnimation, finished flag: Bool) {
starLayer2.addAnimation(animation, forKey: "default")
}
+11 -10
View File
@@ -23,38 +23,38 @@ public class Spinner: IndeterminateAnimation {
return animation
}()
@IBInspectable var starSize:CGSize = CGSize(width: 6, height: 15) {
@IBInspectable public var starSize:CGSize = CGSize(width: 6, height: 15) {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var roundedCorners: Bool = true {
@IBInspectable public var roundedCorners: Bool = true {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var distance: CGFloat = CGFloat(20) {
@IBInspectable public var distance: CGFloat = CGFloat(20) {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var starCount: Int = 10 {
@IBInspectable public var starCount: Int = 10 {
didSet {
notifyViewRedesigned()
}
}
@IBInspectable var duration: Double = 1 {
@IBInspectable public var duration: Double = 1 {
didSet {
animation.duration = duration
}
}
@IBInspectable var clockwise: Bool = false {
@IBInspectable public var clockwise: Bool = false {
didSet {
notifyViewRedesigned()
}
@@ -75,13 +75,13 @@ public class Spinner: IndeterminateAnimation {
starList.removeAll(keepCapacity: 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 }
animation.values.append(iRadian)
var starShape = CAShapeLayer()
animation.values?.append(iRadian)
let starShape = CAShapeLayer()
starShape.cornerRadius = roundedCorners ? starSize.width / 2 : 0
let centerLocation = CGPoint(x: frame.width / 2 - starSize.width / 2, y: frame.width / 2 - starSize.height / 2)
@@ -100,6 +100,7 @@ public class Spinner: IndeterminateAnimation {
starShape.opacity = Float(360 - i) / 360
containerLayer.addSublayer(starShape)
starList.append(starShape)
i = i + Double(360 / starCount)
}
}
+3 -3
View File
@@ -1,13 +1,13 @@
Pod::Spec.new do |spec|
spec.name = 'ProgressKit'
spec.version = '0.0.1'
spec.version = '0.5.1'
spec.license = 'MIT'
spec.summary = 'Animated ProgressViews for OSX'
spec.summary = 'Animated ProgressViews for OS X'
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 }
spec.platform = :osx, '10.9'
spec.platform = :osx, '10.10'
spec.requires_arc = true
spec.source_files = 'Determinate/*.swift', 'InDeterminate/*.swift', 'ProgressUtils.swift', 'BaseView.swift'
+12 -1
View File
@@ -8,6 +8,7 @@
/* 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 = (); }; };
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 */; };
@@ -38,6 +39,7 @@
/* Begin PBXFileReference section */
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>"; };
@@ -87,6 +89,7 @@
E3A468511B5434F7006DDE31 /* Crawler.swift */,
E3918F831B4E88DE00558DAB /* ShootingStars.swift */,
E35D1C6B1B676889001DBAF2 /* Spinner.swift */,
E340FDB71BDE45F000CE6550 /* RotatingArc.swift */,
);
name = Indeterminate;
sourceTree = "<group>";
@@ -205,7 +208,9 @@
E3AD65CA1B426758009541CD /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0630;
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0700;
ORGANIZATIONNAME = "Kauntey Suryawanshi";
TargetAttributes = {
E3AD65D11B426758009541CD = {
@@ -270,6 +275,7 @@
E3918F841B4E88DE00558DAB /* CircularSnail.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 */,
@@ -328,6 +334,7 @@
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -394,6 +401,7 @@
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = ProgressKit/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -405,6 +413,7 @@
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = ProgressKit/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
@@ -424,6 +433,7 @@
);
INFOPLIST_FILE = ProgressKitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit";
};
@@ -440,6 +450,7 @@
);
INFOPLIST_FILE = ProgressKitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit";
};
+215 -14
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="7706" 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="10117" systemVersion="15G31" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
</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"/>
@@ -690,7 +690,7 @@
<scene sceneID="poQ-ev-CZa">
<objects>
<viewController id="rgo-kk-Wcf" customClass="InDeterminateViewController" customModule="ProgressKit" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="lmx-kT-Si1">
<view key="view" wantsLayer="YES" id="lmx-kT-Si1">
<rect key="frame" x="0.0" y="0.0" width="500" height="184"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
@@ -708,7 +708,7 @@
</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"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="size" keyPath="starSize">
<size key="value" width="7" height="14"/>
@@ -720,13 +720,13 @@
</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"/>
<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"/>
<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"/>
@@ -764,7 +764,7 @@
</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"/>
<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 +773,19 @@
<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"/>
<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"/>
</customView>
</subviews>
</view>
</viewController>
@@ -781,15 +794,191 @@
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<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"/>
<rect key="frame" x="20" y="80" width="80" height="80"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.93725490570068359" green="0.92941176891326904" blue="0.92156863212585449" alpha="0.0" colorSpace="calibratedRGB"/>
@@ -800,7 +989,7 @@
</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"/>
<rect key="frame" x="235" y="80" width="80" height="80"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.13725490868091583" green="0.49019607901573181" blue="0.81568628549575806" alpha="0.57000000000000006" colorSpace="calibratedRGB"/>
@@ -817,7 +1006,7 @@
</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"/>
<rect key="frame" x="370" y="102" width="40" height="40"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="background">
<color key="value" red="0.13725490868091583" green="0.49019607901573181" blue="0.81568628549575806" alpha="0.0" colorSpace="calibratedRGB"/>
@@ -831,19 +1020,31 @@
</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"/>
<rect key="frame" x="123" y="80" width="80" height="80"/>
<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"/>
</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"/>
<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">
+2 -2
View File
@@ -22,9 +22,9 @@ class DeterminateViewController: NSViewController {
@IBAction func sliderDragged(sender: NSSlider) {
let event = NSApplication.sharedApplication().currentEvent
let dragStart = event!.type == NSEventType.LeftMouseDown
// let dragStart = event!.type == NSEventType.LeftMouseDown
let dragEnd = event!.type == NSEventType.LeftMouseUp
let dragging = event!.type == NSEventType.LeftMouseDragged
// let dragging = event!.type == NSEventType.LeftMouseDragged
if liveProgress || dragEnd {
setProgress(CGFloat(sender.floatValue))
+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
@@ -9,7 +9,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
+1 -1
View File
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
+25 -23
View File
@@ -18,36 +18,38 @@ extension NSRect {
extension NSBezierPath {
/// Converts NSBezierPath to CGPath
var CGPath: CGPathRef {
var path = CGPathCreateMutable()
var points = UnsafeMutablePointer<NSPoint>.alloc(3)
let path = CGPathCreateMutable()
let points = UnsafeMutablePointer<NSPoint>.alloc(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.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)
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)
}
if !didClosePath { CGPathCloseSubpath(path) }
}
points.dealloc(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)
}
+28 -8
View File
@@ -1,22 +1,33 @@
![Image](/Images/banner.png)
![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 can be finely customised according to your app palette.
# Contents
- [Installation](#installation)
- [Usage](#usage)
- [Indeterminate Progress](#indeterminate-progress)
- [CircularSnail](#circularsnail)
- [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)
- [License](#license)
# 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`:
@@ -34,11 +45,11 @@ $ pod install
# Usage
- Drag a View at desired location in `XIB` or `Storyboard`
- Change the Class to any of the desired progress Views
- Change the Class to any of the desired progress views
- Set the size such that width and height are equal
- Drag `IBOutlet` to View Controller
- For `Indeterminate` Progress Views
- Call `view.startAnimation()` and `view.stopAnimation()`
- Set `true / false` to `view.animate`
- For `Determinate` Progress Views:
- Set `view.progress` to value in `0...1`
@@ -48,20 +59,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
![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)
@@ -69,4 +87,6 @@ Determinate progress views can be used for tasks whos progress can be seen and d
## Progress Bar
![Progress Bar](/Images/ProgressBar.png)
# License
`ProgressKit` is released under the MIT license. See LICENSE for details.