Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f19f111ec3 | |||
| d190fa6fd8 | |||
| 6d011fd523 | |||
| b7f936dd4f | |||
| 4a02dd081a |
@@ -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)
|
||||
|
||||
@@ -15,7 +15,7 @@ open class ProgressBar: DeterminateAnimation {
|
||||
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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}()
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'ProgressKit'
|
||||
spec.version = '0.7'
|
||||
spec.version = '0.8'
|
||||
spec.license = 'MIT'
|
||||
spec.summary = 'Animated ProgressViews for macOS'
|
||||
spec.homepage = 'https://github.com/kaunteya/ProgressKit'
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
attributes = {
|
||||
LastSwiftMigration = 0700;
|
||||
LastSwiftUpdateCheck = 0700;
|
||||
LastUpgradeCheck = 0920;
|
||||
LastUpgradeCheck = 1000;
|
||||
ORGANIZATIONNAME = "Kauntey Suryawanshi";
|
||||
TargetAttributes = {
|
||||
E3AD65D11B426758009541CD = {
|
||||
@@ -329,12 +329,14 @@
|
||||
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;
|
||||
@@ -382,12 +384,14 @@
|
||||
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;
|
||||
@@ -424,8 +428,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;
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
@@ -438,8 +442,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;
|
||||
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
|
||||
SWIFT_VERSION = 4.2;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
|
||||
+5
-5
@@ -25,18 +25,18 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ You can now make spinners, progress bar, crawlers etc, which can be finely custo
|
||||
- [Determinate Progress](#determinate-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
|
||||

|
||||
|
||||
# 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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user