Skip to content
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaunteya Suryawanshi authored and Kaunteya Suryawanshi committed Oct 10, 2018
1 parent b7f936d commit 6d011fd
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Determinate/CircularProgressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ open class CircularProgressView: DeterminateAnimation {
do {
progressLayer.strokeEnd = 0 //REMOVe this
progressLayer.fillColor = NSColor.clear.cgColor
progressLayer.lineCap = CAShapeLayerLineCap.round
progressLayer.lineCap = .round
progressLayer.lineWidth = strokeWidth == -1 ? (rect.width * strokeScalingFactor) : strokeWidth

progressLayer.frame = rect
Expand Down
4 changes: 2 additions & 2 deletions Determinate/ProgressBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -51,7 +51,7 @@ open class ProgressBar: DeterminateAnimation {
} else {
CATransaction.setDisableActions(true)
}
let timing = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut)
let timing = CAMediaTimingFunction(name: .easeOut)
CATransaction.setAnimationTimingFunction(timing)
progressLayer.frame.size.width = (borderLayer.bounds.width - 6) * progress
CATransaction.commit()
Expand Down
4 changes: 2 additions & 2 deletions InDeterminate/Crawler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ open class Crawler: IndeterminateAnimation {
rotationAnimation.path = arcPath.CGPath
rotationAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeOut)
rotationAnimation.beginTime = (duration * 0.075) * Double(i)
rotationAnimation.calculationMode = CAAnimationCalculationMode.cubicPaced
rotationAnimation.calculationMode = .cubicPaced

let animationGroup = CAAnimationGroup()
animationGroup.animations = [rotationAnimation]
animationGroup.duration = duration
animationGroup.repeatCount = Float.infinity
animationGroup.repeatCount = .infinity
animationGroups.append(animationGroup)

}
Expand Down
4 changes: 2 additions & 2 deletions InDeterminate/MaterialProgress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ open class MaterialProgress: IndeterminateAnimation {
var progressLayer: CAShapeLayer = {
var tempLayer = CAShapeLayer()
tempLayer.strokeEnd = CGFloat(strokeRange.end)
tempLayer.lineCap = CAShapeLayerLineCap.round
tempLayer.lineCap = .round
tempLayer.fillColor = NSColor.clear.cgColor
return tempLayer
}()
Expand Down Expand Up @@ -64,7 +64,7 @@ open class MaterialProgress: IndeterminateAnimation {
let tempAnimation = CABasicAnimation(keyPath: keyPath)
tempAnimation.repeatCount = 1
tempAnimation.speed = 2.0
tempAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)
tempAnimation.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)

tempAnimation.fromValue = strokeRange.start
tempAnimation.toValue = strokeRange.end
Expand Down
2 changes: 1 addition & 1 deletion InDeterminate/RotatingArc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions InDeterminate/ShootingStars.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ open class ShootingStars: IndeterminateAnimation {
animation.fromValue = -dimension
animation.toValue = rect.width * 0.9
animation.duration = animationDuration
animation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn)
animation.timingFunction = CAMediaTimingFunction(name: .easeIn)
animation.isRemovedOnCompletion = false
animation.repeatCount = Float.infinity
animation.repeatCount = .infinity
}

/** Temp animation will be removed after first animation
Expand All @@ -64,7 +64,7 @@ open class ShootingStars: IndeterminateAnimation {
tempAnimation.toValue = rect.width
tempAnimation.delegate = self
tempAnimation.duration = animationDuration / 2
tempAnimation.timingFunction = CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeIn)
tempAnimation.timingFunction = CAMediaTimingFunction(name: .easeIn)
}

//MARK: Indeterminable protocol
Expand Down
4 changes: 2 additions & 2 deletions InDeterminate/Spinner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ open class Spinner: IndeterminateAnimation {

var animation: CAKeyframeAnimation = {
var animation = CAKeyframeAnimation(keyPath: "transform.rotation")
animation.repeatCount = Float.infinity
animation.calculationMode = CAAnimationCalculationMode.discrete
animation.repeatCount = .infinity
animation.calculationMode = .discrete
return animation
}()

Expand Down
14 changes: 9 additions & 5 deletions ProgressKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0920;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = "Kauntey Suryawanshi";
TargetAttributes = {
E3AD65D11B426758009541CD = {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion ProgressUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension NSBezierPath {
}
}

points.deallocate(capacity: 3)
points.deallocate()
return path
}
}
Expand Down

0 comments on commit 6d011fd

Please sign in to comment.