Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7d84b4e697 | |||
| 27cdcf5c53 | |||
| 0113a09f57 | |||
| a3b7a4c3bc | |||
| b9fef1fb29 | |||
| 9f7a41e2d8 | |||
| c6b46dcd53 |
+4
-4
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -17,14 +17,14 @@ protocol AnimationActivityProtocol {
|
||||
public class IndeterminateAnimation: BaseView, AnimationActivityProtocol {
|
||||
|
||||
/// View is hidden when *animate* property is false
|
||||
@IBInspectable var displayAfterAnimationEnds: Bool = 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
|
||||
*/
|
||||
var animate: Bool = false {
|
||||
public var animate: Bool = false {
|
||||
didSet {
|
||||
if animate {
|
||||
self.hidden = false
|
||||
|
||||
@@ -12,7 +12,7 @@ import Cocoa
|
||||
@IBDesignable
|
||||
public class Rainbow: CircularSnail {
|
||||
|
||||
@IBInspectable var onLightOffDark: Bool = false
|
||||
@IBInspectable public var onLightOffDark: Bool = false
|
||||
|
||||
override func configureLayers() {
|
||||
super.configureLayers()
|
||||
|
||||
@@ -17,19 +17,19 @@ public class RotatingArc: IndeterminateAnimation {
|
||||
var backgroundCircle = CAShapeLayer()
|
||||
var arcLayer = CAShapeLayer()
|
||||
|
||||
@IBInspectable var strokeWidth: CGFloat = 5 {
|
||||
@IBInspectable public var strokeWidth: CGFloat = 5 {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable var arcLength: Int = 35 {
|
||||
@IBInspectable public var arcLength: Int = 35 {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
}
|
||||
|
||||
@IBInspectable var clockWise: Bool = true {
|
||||
@IBInspectable public var clockWise: Bool = true {
|
||||
didSet {
|
||||
notifyViewRedesigned()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = 'ProgressKit'
|
||||
spec.version = '0.4.0'
|
||||
spec.version = '0.4.1'
|
||||
spec.license = 'MIT'
|
||||
spec.summary = 'Animated ProgressViews for OS X'
|
||||
spec.homepage = 'https://github.com/kaunteya/ProgressKit'
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
|
||||

|
||||

|
||||
|
||||
[](https://img.shields.io/cocoapods/v/ProgressKit.svg)
|
||||
[](http://cocoadocs.org/docsets/ProgressKit)
|
||||
[](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 nicely gets integrated according to your app theme.
|
||||
You can now make spinners, progress bar, crawlers etc, which can be finely customised according to your app palette.
|
||||
|
||||
# Contents
|
||||
- [Installation](#installation)
|
||||
@@ -43,7 +49,7 @@ $ pod install
|
||||
- Set the size such that width and height are equal
|
||||
- Drag `IBOutlet` to View Controller
|
||||
- For `Indeterminate` Progress Views
|
||||
- Set `Boolean` value to `view.animate`
|
||||
- Set `true / false` to `view.animate`
|
||||
- For `Determinate` Progress Views:
|
||||
- Set `view.progress` to value in `0...1`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user