From c11702151fd3aa676711f15ecb0030d33ae2e080 Mon Sep 17 00:00:00 2001 From: Luis Padron Date: Fri, 20 Jan 2017 23:51:22 -0500 Subject: [PATCH] Revert back to using draw(rect:) - Remove prepareForStoryboard - Add back draw(rec:) method - Switch layer class of UICircularProgressRingLayer to CAShapeLayer - Reran jazzy for docs - Update CHANGELOG --- CHANGELOG.md | 6 ++++++ UICircularProgressRing.podspec | 2 +- .../UICircularProgressRingLayer.swift | 6 +++--- .../UICircularProgressRingView.swift | 11 +++++----- docs/Classes.html | 2 +- docs/Classes/UICircularProgressRingView.html | 20 +++++++++--------- .../Contents/Resources/Documents/Classes.html | 2 +- .../Classes/UICircularProgressRingView.html | 20 +++++++++--------- .../Contents/Resources/docSet.dsidx | Bin 28672 -> 28672 bytes docs/docsets/UICircularProgressRing.tgz | Bin 52462 -> 52450 bytes 10 files changed, 37 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0889a6e..31b79d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Version 1.1.9 + + +- Revert back to using `draw(rect:)` as was having issues with nib loaded views? +- Change class of UICircularProgressRingLayer from `CALayer` to `CAShapeLayer` + # Version 1.1.8 - Remove overriden `draw(rect:)` method to avoid any issues with performance and iOS drawing diff --git a/UICircularProgressRing.podspec b/UICircularProgressRing.podspec index 154f2e70..21942b2d 100644 --- a/UICircularProgressRing.podspec +++ b/UICircularProgressRing.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = "UICircularProgressRing" - s.version = "1.1.8" + s.version = "1.1.9" s.summary = "A highly customizable circular progress bar for iOS written in Swift 3" s.description = <<-DESC diff --git a/UICircularProgressRing/UICircularProgressRingLayer.swift b/UICircularProgressRing/UICircularProgressRingLayer.swift index 8dafc3ec..2b4a3e7b 100644 --- a/UICircularProgressRing/UICircularProgressRingLayer.swift +++ b/UICircularProgressRing/UICircularProgressRingLayer.swift @@ -48,18 +48,18 @@ private extension UILabel { } /** - The internal subclass for CALayer. + The internal subclass for CAShapeLayer. This is the class that handles all the drawing and animation. This class is not interacted with, instead properties are set in UICircularProgressRingView and those are delegated to here. */ -class UICircularProgressRingLayer: CALayer { +class UICircularProgressRingLayer: CAShapeLayer { // MARK: Properties /** - The NSManaged properties for the CALayer. + The NSManaged properties for the layer. These properties are initialized in UICircularProgressRingView. They're also assigned by mutating UICircularProgressRingView. */ diff --git a/UICircularProgressRing/UICircularProgressRingView.swift b/UICircularProgressRing/UICircularProgressRingView.swift index 719aa024..b44c259f 100644 --- a/UICircularProgressRing/UICircularProgressRingView.swift +++ b/UICircularProgressRing/UICircularProgressRingView.swift @@ -29,7 +29,7 @@ import UIKit This is the UIView subclass that creates and handles everything to do with the progress ring - This class has a custom CALayer (UICircularProgressRingLayer) which + This class has a custom CAShapeLayer (UICircularProgressRingLayer) which handels the drawing and animating of the view The properties in this class correspond with the properties in UICircularProgressRingLayer. @@ -505,7 +505,7 @@ import UIKit get { return (self.layer.animation(forKey: "value") != nil) ? true : false } } - // MARK: CALayer + // MARK: Layer /** Set the ring layer to the default layer, cated as custom layer @@ -579,11 +579,10 @@ import UIKit } /** - Prepares to draw the view for use with interface builder + Overriden because of custom layer drawing in UICircularProgressRingLayer */ - open override func prepareForInterfaceBuilder() { - super.prepareForInterfaceBuilder() - self.setNeedsDisplay() + open override func draw(_ rect: CGRect) { + super.draw(rect) } diff --git a/docs/Classes.html b/docs/Classes.html index 648db818..de3260e2 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -90,7 +90,7 @@

Classes

This is the UIView subclass that creates and handles everything to do with the progress ring

-

This class has a custom CALayer (UICircularProgressRingLayer) which +

This class has a custom CAShapeLayer (UICircularProgressRingLayer) which handels the drawing and animating of the view

The properties in this class correspond with the properties in UICircularProgressRingLayer. diff --git a/docs/Classes/UICircularProgressRingView.html b/docs/Classes/UICircularProgressRingView.html index 64498f1a..97d03d71 100644 --- a/docs/Classes/UICircularProgressRingView.html +++ b/docs/Classes/UICircularProgressRingView.html @@ -75,7 +75,7 @@

UICircularProgressRingView

This is the UIView subclass that creates and handles everything to do with the progress ring

-

This class has a custom CALayer (UICircularProgressRingLayer) which +

This class has a custom CAShapeLayer (UICircularProgressRingLayer) which handels the drawing and animating of the view

The properties in this class correspond with the properties in UICircularProgressRingLayer. @@ -1061,10 +1061,10 @@

Declaration