15 Commits

Author SHA1 Message Date
Kaunteya Suryawanshi f19f111ec3 Updated REAdME 2020-04-04 14:22:19 +05:30
Kaunteya Suryawanshi d190fa6fd8 Added Other Apps Section 2020-04-04 14:03:35 +05:30
Kaunteya Suryawanshi 6d011fd523 Cleanup 2018-10-10 12:31:12 +05:30
Kaunteya Suryawanshi b7f936dd4f Merge pull request #19 from EpicDraws/master
Changes to support Swift 4.2
2018-10-10 12:15:36 +05:30
EpicDraws 4a02dd081a Changes to support Swift 4.2 2018-10-07 18:33:21 -07:00
Kaunteya Suryawanshi 37b7e3a3b7 Updated podspec 2018-03-15 15:44:27 +05:30
Kaunteya Suryawanshi d5ae9526be Updates for Swift 4 2018-03-15 15:43:13 +05:30
Kaunteya Suryawanshi 5ba59404e8 Updated README 2017-09-28 10:29:30 +05:30
Kaunteya Suryawanshi 325b0d7602 Merge pull request #15 from jbuckner/layer_access
Add `open` designation to Determinate layers
2017-05-28 13:08:01 +05:30
Kaunteya Suryawanshi 1a574d7024 Merge pull request #14 from jbuckner/M_PI-deprecations
Use Double.pi instead of M_PI
2017-05-28 13:06:33 +05:30
Jason Buckner b986faf947 Use Double.pi instead of M_PI 2017-05-23 20:14:25 -07:00
Jason Buckner ac97b80638 Add open designation to Determinate layers
This allows the consumer to customize them
2017-05-23 20:11:06 -07:00
Kaunteya Suryawanshi fca07a4fbd updated to 0.6.1 2016-10-02 17:35:50 +05:30
Kaunteya Suryawanshi 643ac6ee2c Added .swift-version 2016-10-02 17:33:44 +05:30
Kaunteya Suryawanshi 68b340a337 Minor cleanup 2016-09-27 21:36:57 +05:30
15 changed files with 87 additions and 52 deletions
+1
View File
@@ -1,3 +1,4 @@
.DS_Store
# Xcode
#
build/
+1
View File
@@ -0,0 +1 @@
3.0
+6 -6
View File
@@ -12,9 +12,9 @@ import Cocoa
@IBDesignable
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 open var strokeWidth: CGFloat = -1 {
didSet {
@@ -46,7 +46,7 @@ open class CircularProgressView: DeterminateAnimation {
} else {
CATransaction.setDisableActions(true)
}
let timing = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
let timing = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut)
CATransaction.setAnimationTimingFunction(timing)
progressLayer.strokeEnd = max(0, min(progress, 1))
percentLabelLayer.string = "\(Int(progress * 100))%"
@@ -77,7 +77,7 @@ open class CircularProgressView: DeterminateAnimation {
do {
progressLayer.strokeEnd = 0 //REMOVe this
progressLayer.fillColor = NSColor.clear.cgColor
progressLayer.lineCap = kCALineCapRound
progressLayer.lineCap = .round
progressLayer.lineWidth = strokeWidth == -1 ? (rect.width * strokeScalingFactor) : strokeWidth
progressLayer.frame = rect
@@ -95,7 +95,7 @@ open class CircularProgressView: DeterminateAnimation {
percentLabelLayer.foregroundColor = foreground.cgColor
percentLabelLayer.frame = rect
percentLabelLayer.font = "Helvetica Neue Light" as CFTypeRef
percentLabelLayer.alignmentMode = kCAAlignmentCenter
percentLabelLayer.alignmentMode = CATextLayerAlignmentMode.center
percentLabelLayer.position.y = rect.midY * 0.25
percentLabelLayer.fontSize = rect.width * 0.2
self.layer?.addSublayer(percentLabelLayer)
+4 -4
View File
@@ -12,10 +12,10 @@ import Cocoa
@IBDesignable
open class ProgressBar: DeterminateAnimation {
var borderLayer = CAShapeLayer()
var progressLayer = CAShapeLayer()
open var borderLayer = CAShapeLayer()
open var progressLayer = CAShapeLayer()
@IBInspectable open var borderColor: NSColor = NSColor.black {
@IBInspectable open var borderColor: NSColor = .black {
didSet {
notifyViewRedesigned()
}
@@ -51,7 +51,7 @@ open class ProgressBar: DeterminateAnimation {
} else {
CATransaction.setDisableActions(true)
}
let timing = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
let timing = CAMediaTimingFunction(name: .easeOut)
CATransaction.setAnimationTimingFunction(timing)
progressLayer.frame.size.width = (borderLayer.bounds.width - 6) * progress
CATransaction.commit()
+3 -3
View File
@@ -52,14 +52,14 @@ open class Crawler: IndeterminateAnimation {
let rotationAnimation = CAKeyframeAnimation(keyPath: "position")
rotationAnimation.path = arcPath.CGPath
rotationAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseOut)
rotationAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut)
rotationAnimation.beginTime = (duration * 0.075) * Double(i)
rotationAnimation.calculationMode = kCAAnimationCubicPaced
rotationAnimation.calculationMode = .cubicPaced
let animationGroup = CAAnimationGroup()
animationGroup.animations = [rotationAnimation]
animationGroup.duration = duration
animationGroup.repeatCount = Float.infinity
animationGroup.repeatCount = .infinity
animationGroups.append(animationGroup)
}
+3 -3
View File
@@ -31,7 +31,7 @@ open class MaterialProgress: IndeterminateAnimation {
var progressLayer: CAShapeLayer = {
var tempLayer = CAShapeLayer()
tempLayer.strokeEnd = CGFloat(strokeRange.end)
tempLayer.lineCap = kCALineCapRound
tempLayer.lineCap = .round
tempLayer.fillColor = NSColor.clear.cgColor
return tempLayer
}()
@@ -64,7 +64,7 @@ open class MaterialProgress: IndeterminateAnimation {
let tempAnimation = CABasicAnimation(keyPath: keyPath)
tempAnimation.repeatCount = 1
tempAnimation.speed = 2.0
tempAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
tempAnimation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
tempAnimation.fromValue = strokeRange.start
tempAnimation.toValue = strokeRange.end
@@ -98,7 +98,7 @@ open class MaterialProgress: IndeterminateAnimation {
}
var currentRotation = 0.0
let π2 = M_PI * 2
let π2 = Double.pi * 2
override func startAnimation() {
progressLayer.add(animationGroup, forKey: "strokeEnd")
+1 -1
View File
@@ -41,7 +41,7 @@ open class RotatingArc: IndeterminateAnimation {
var rotationAnimation: CABasicAnimation = {
var tempRotation = CABasicAnimation(keyPath: "transform.rotation")
tempRotation.repeatCount = Float.infinity
tempRotation.repeatCount = .infinity
tempRotation.fromValue = 0
tempRotation.toValue = 1
tempRotation.isCumulative = true
+3 -3
View File
@@ -51,9 +51,9 @@ open class ShootingStars: IndeterminateAnimation {
animation.fromValue = -dimension
animation.toValue = rect.width * 0.9
animation.duration = animationDuration
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
animation.timingFunction = CAMediaTimingFunction(name: .easeIn)
animation.isRemovedOnCompletion = false
animation.repeatCount = Float.infinity
animation.repeatCount = .infinity
}
/** Temp animation will be removed after first animation
@@ -64,7 +64,7 @@ open class ShootingStars: IndeterminateAnimation {
tempAnimation.toValue = rect.width
tempAnimation.delegate = self
tempAnimation.duration = animationDuration / 2
tempAnimation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseIn)
tempAnimation.timingFunction = CAMediaTimingFunction(name: .easeIn)
}
//MARK: Indeterminable protocol
+3 -3
View File
@@ -18,8 +18,8 @@ open class Spinner: IndeterminateAnimation {
var animation: CAKeyframeAnimation = {
var animation = CAKeyframeAnimation(keyPath: "transform.rotation")
animation.repeatCount = Float.infinity
animation.calculationMode = kCAAnimationDiscrete
animation.repeatCount = .infinity
animation.calculationMode = .discrete
return animation
}()
@@ -77,7 +77,7 @@ open class Spinner: IndeterminateAnimation {
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)
+1 -1
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'ProgressKit'
spec.version = '0.6'
spec.version = '0.8'
spec.license = 'MIT'
spec.summary = 'Animated ProgressViews for macOS'
spec.homepage = 'https://github.com/kaunteya/ProgressKit'
+27 -13
View File
@@ -7,8 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
E310B1D31D7AB2D4008DEF62 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = E310B1D21D7AB2D4008DEF62 /* README.md */; };
E310B1D51D7AB2EA008DEF62 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = E310B1D41D7AB2EA008DEF62 /* LICENSE */; };
E31617A61BC0596C007AD70F /* BaseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E31617A51BC0596C007AD70F /* BaseView.swift */; };
E340FDB81BDE45F000CE6550 /* RotatingArc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E340FDB71BDE45F000CE6550 /* RotatingArc.swift */; };
E35D1C6C1B676889001DBAF2 /* Spinner.swift in Sources */ = {isa = PBXBuildFile; fileRef = E35D1C6B1B676889001DBAF2 /* Spinner.swift */; };
@@ -25,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 */
@@ -216,16 +213,16 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0800;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Kauntey Suryawanshi";
TargetAttributes = {
E3AD65D11B426758009541CD = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 0920;
};
E3AD65E31B426758009541CD = {
CreatedOnToolsVersion = 6.3.2;
LastSwiftMigration = 0800;
LastSwiftMigration = 0920;
TestTargetID = E3AD65D11B426758009541CD;
};
};
@@ -254,8 +251,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
E310B1D51D7AB2EA008DEF62 /* LICENSE in Resources */,
E3CCD5981BBC19ED00F7DB9A /* ProgressKit.podspec in Resources */,
E3AD65DF1B426758009541CD /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -280,7 +275,6 @@
E3AD65F71B427511009541CD /* InDeterminateVC.swift in Sources */,
E3918F851B4E88DE00558DAB /* ShootingStars.swift in Sources */,
E3918F811B4E88CF00558DAB /* CircularProgressView.swift in Sources */,
E310B1D31D7AB2D4008DEF62 /* README.md in Sources */,
E35D1C6C1B676889001DBAF2 /* Spinner.swift in Sources */,
E3918F841B4E88DE00558DAB /* MaterialProgress.swift in Sources */,
E3AD65D81B426758009541CD /* AppDelegate.swift in Sources */,
@@ -331,14 +325,22 @@
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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;
@@ -378,14 +380,22 @@
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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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;
@@ -418,7 +428,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
@@ -431,7 +442,8 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.kaunteya.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
};
name = Release;
};
@@ -452,7 +464,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_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit";
};
name = Debug;
@@ -470,7 +483,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_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ProgressKit.app/Contents/MacOS/ProgressKit";
};
name = Release;
+4 -4
View File
@@ -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)
@@ -21,9 +21,9 @@ class DeterminateViewController: NSViewController {
@IBAction func sliderDragged(_ sender: NSSlider) {
let event = NSApplication.shared().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 {
-3
View File
@@ -28,9 +28,6 @@ class ProgressKitTests: XCTestCase {
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure() {
// Put the code you want to measure the time of here.
}
}
}
+7 -7
View File
@@ -25,28 +25,28 @@ extension NSBezierPath {
for index in 0..<numElements {
let pathType = self.element(at: index, associatedPoints: points)
switch pathType {
case .moveToBezierPathElement:
case .moveTo:
path.move(to: points[0])
case .lineToBezierPathElement:
case .lineTo:
path.addLine(to: points[0])
case .curveToBezierPathElement:
case .curveTo:
path.addCurve(to: points[2], control1: points[0], control2: points[1])
case .closePathBezierPathElement:
case .closePath:
path.closeSubpath()
}
}
points.deallocate(capacity: 3)
points.deallocate()
return path
}
}
func degreeToRadian(_ degree: Int) -> Double {
return Double(degree) * (M_PI / 180)
return Double(degree) * (Double.pi / 180)
}
func radianToDegree(_ radian: Double) -> Int {
return Int(radian * (180 / M_PI))
return Int(radian * (180 / Double.pi))
}
func + (p1: CGPoint, p2: CGPoint) -> CGPoint {
+23 -1
View File
@@ -21,8 +21,9 @@ You can now make spinners, progress bar, crawlers etc, which can be finely custo
- [Shooting Stars](#shooting-stars)
- [Rotating Arc](#rotating-arc)
- [Determinate Progress](#determinate-progress)
- [Circular Progress] (#circular-progress)
- [Circular Progress](#circular-progress)
- [Progress Bar](#progress-bar)
- [Other Apps](#other-apps)
- [License](#license)
# Installation
@@ -92,6 +93,27 @@ Determinate progress views can be used for tasks whos progress can be seen and d
## Progress Bar
![Progress Bar](/Images/ProgressBar.png)
# Other Apps for Mac
Apart from making Open source libraries I also make apps for Mac OS. Please have a look.
## [Lexi](https://apps.apple.com/tr/app/lexi-visual-json-browser/id1462580127?mt=12)
Lexi is a split screen app that lets you browse large JSON with ease.
It also has other featuers like `Prettify JSON`, `Minify JSON` `Copy JSON Path` and `Pin Large JSON` to narrow your visibility
[View on Mac AppStore](https://apps.apple.com/tr/app/lexi-visual-json-browser/id1462580127?mt=12)
## [Quick Note](https://apps.apple.com/in/app/quicknote-one-click-notes/id1472935217?mt=12)
Quick Note is a Mac OS app, lets you quickly add text either from Menu bar or from Shortcut.
The text floats on other windows so that they are always visible
It also supports `Auto Save` and `Pinned Notes`
[View on Mac AppStore](https://apps.apple.com/in/app/quicknote-one-click-notes/id1472935217?mt=12)
# License
`ProgressKit` is released under the MIT license. See LICENSE for details.