Skip to content
This repository was archived by the owner on Jan 19, 2022. It is now read-only.

Commit c117021

Browse files
Luis PadronLuis Padron
Luis Padron
authored and
Luis Padron
committed
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
1 parent 270c9f0 commit c117021

10 files changed

+37
-32
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Version 1.1.9
2+
3+
4+
- Revert back to using `draw(rect:)` as was having issues with nib loaded views?
5+
- Change class of UICircularProgressRingLayer from `CALayer` to `CAShapeLayer`
6+
17
# Version 1.1.8
28

39
- Remove overriden `draw(rect:)` method to avoid any issues with performance and iOS drawing

UICircularProgressRing.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Pod::Spec.new do |s|
33

44
s.name = "UICircularProgressRing"
5-
s.version = "1.1.8"
5+
s.version = "1.1.9"
66
s.summary = "A highly customizable circular progress bar for iOS written in Swift 3"
77

88
s.description = <<-DESC

UICircularProgressRing/UICircularProgressRingLayer.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ private extension UILabel {
4848
}
4949

5050
/**
51-
The internal subclass for CALayer.
51+
The internal subclass for CAShapeLayer.
5252
This is the class that handles all the drawing and animation.
5353
This class is not interacted with, instead properties are set in UICircularProgressRingView
5454
and those are delegated to here.
5555

5656
*/
57-
class UICircularProgressRingLayer: CALayer {
57+
class UICircularProgressRingLayer: CAShapeLayer {
5858

5959
// MARK: Properties
6060

6161
/**
62-
The NSManaged properties for the CALayer.
62+
The NSManaged properties for the layer.
6363
These properties are initialized in UICircularProgressRingView.
6464
They're also assigned by mutating UICircularProgressRingView.
6565
*/

UICircularProgressRing/UICircularProgressRingView.swift

+5-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import UIKit
2929
This is the UIView subclass that creates and handles everything
3030
to do with the progress ring
3131

32-
This class has a custom CALayer (UICircularProgressRingLayer) which
32+
This class has a custom CAShapeLayer (UICircularProgressRingLayer) which
3333
handels the drawing and animating of the view
3434

3535
The properties in this class correspond with the properties in UICircularProgressRingLayer.
@@ -505,7 +505,7 @@ import UIKit
505505
get { return (self.layer.animation(forKey: "value") != nil) ? true : false }
506506
}
507507

508-
// MARK: CALayer
508+
// MARK: Layer
509509

510510
/**
511511
Set the ring layer to the default layer, cated as custom layer
@@ -579,11 +579,10 @@ import UIKit
579579
}
580580

581581
/**
582-
Prepares to draw the view for use with interface builder
582+
Overriden because of custom layer drawing in UICircularProgressRingLayer
583583
*/
584-
open override func prepareForInterfaceBuilder() {
585-
super.prepareForInterfaceBuilder()
586-
self.setNeedsDisplay()
584+
open override func draw(_ rect: CGRect) {
585+
super.draw(rect)
587586
}
588587

589588

docs/Classes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h1>Classes</h1>
9090
<p>This is the UIView subclass that creates and handles everything
9191
to do with the progress ring</p>
9292

93-
<p>This class has a custom CALayer (UICircularProgressRingLayer) which
93+
<p>This class has a custom CAShapeLayer (UICircularProgressRingLayer) which
9494
handels the drawing and animating of the view</p>
9595

9696
<p>The properties in this class correspond with the properties in UICircularProgressRingLayer.

docs/Classes/UICircularProgressRingView.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ <h1>UICircularProgressRingView</h1>
7575
<p>This is the UIView subclass that creates and handles everything
7676
to do with the progress ring</p>
7777

78-
<p>This class has a custom CALayer (UICircularProgressRingLayer) which
78+
<p>This class has a custom CAShapeLayer (UICircularProgressRingLayer) which
7979
handels the drawing and animating of the view</p>
8080

8181
<p>The properties in this class correspond with the properties in UICircularProgressRingLayer.
@@ -1061,10 +1061,10 @@ <h4>Declaration</h4>
10611061
</div>
10621062
<div class="task-group">
10631063
<div class="task-name-container">
1064-
<a name="/CALayer"></a>
1065-
<a name="//apple_ref/swift/Section/CALayer" class="dashAnchor"></a>
1066-
<a href="#/CALayer">
1067-
<h3 class="section-name">CALayer</h3>
1064+
<a name="/Layer"></a>
1065+
<a name="//apple_ref/swift/Section/Layer" class="dashAnchor"></a>
1066+
<a href="#/Layer">
1067+
<h3 class="section-name">Layer</h3>
10681068
</a>
10691069
</div>
10701070
<ul class="item-container">
@@ -1163,24 +1163,24 @@ <h4>Declaration</h4>
11631163
<li class="item">
11641164
<div>
11651165
<code>
1166-
<a name="/s:FC22UICircularProgressRing26UICircularProgressRingView26prepareForInterfaceBuilderFT_T_"></a>
1167-
<a name="//apple_ref/swift/Method/prepareForInterfaceBuilder()" class="dashAnchor"></a>
1168-
<a class="token" href="#/s:FC22UICircularProgressRing26UICircularProgressRingView26prepareForInterfaceBuilderFT_T_">prepareForInterfaceBuilder()</a>
1166+
<a name="/s:FC22UICircularProgressRing26UICircularProgressRingView4drawFVSC6CGRectT_"></a>
1167+
<a name="//apple_ref/swift/Method/draw(_:)" class="dashAnchor"></a>
1168+
<a class="token" href="#/s:FC22UICircularProgressRing26UICircularProgressRingView4drawFVSC6CGRectT_">draw(_:)</a>
11691169
</code>
11701170
</div>
11711171
<div class="height-container">
11721172
<div class="pointer-container"></div>
11731173
<section class="section">
11741174
<div class="pointer"></div>
11751175
<div class="abstract">
1176-
<p>Prepares to draw the view for use with interface builder</p>
1176+
<p>Overriden because of custom layer drawing in UICircularProgressRingLayer</p>
11771177

11781178
</div>
11791179
<div class="declaration">
11801180
<h4>Declaration</h4>
11811181
<div class="language">
11821182
<p class="aside-title">Swift</p>
1183-
<pre class="highlight"><code><span class="n">open</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">prepareForInterfaceBuilder</span><span class="p">()</span></code></pre>
1183+
<pre class="highlight"><code><span class="n">open</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">draw</span><span class="p">(</span><span class="n">_</span> <span class="nv">rect</span><span class="p">:</span> <span class="kt">CGRect</span><span class="p">)</span></code></pre>
11841184

11851185
</div>
11861186
</div>

docs/docsets/UICircularProgressRing.docset/Contents/Resources/Documents/Classes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ <h1>Classes</h1>
9090
<p>This is the UIView subclass that creates and handles everything
9191
to do with the progress ring</p>
9292

93-
<p>This class has a custom CALayer (UICircularProgressRingLayer) which
93+
<p>This class has a custom CAShapeLayer (UICircularProgressRingLayer) which
9494
handels the drawing and animating of the view</p>
9595

9696
<p>The properties in this class correspond with the properties in UICircularProgressRingLayer.

docs/docsets/UICircularProgressRing.docset/Contents/Resources/Documents/Classes/UICircularProgressRingView.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ <h1>UICircularProgressRingView</h1>
7575
<p>This is the UIView subclass that creates and handles everything
7676
to do with the progress ring</p>
7777

78-
<p>This class has a custom CALayer (UICircularProgressRingLayer) which
78+
<p>This class has a custom CAShapeLayer (UICircularProgressRingLayer) which
7979
handels the drawing and animating of the view</p>
8080

8181
<p>The properties in this class correspond with the properties in UICircularProgressRingLayer.
@@ -1061,10 +1061,10 @@ <h4>Declaration</h4>
10611061
</div>
10621062
<div class="task-group">
10631063
<div class="task-name-container">
1064-
<a name="/CALayer"></a>
1065-
<a name="//apple_ref/swift/Section/CALayer" class="dashAnchor"></a>
1066-
<a href="#/CALayer">
1067-
<h3 class="section-name">CALayer</h3>
1064+
<a name="/Layer"></a>
1065+
<a name="//apple_ref/swift/Section/Layer" class="dashAnchor"></a>
1066+
<a href="#/Layer">
1067+
<h3 class="section-name">Layer</h3>
10681068
</a>
10691069
</div>
10701070
<ul class="item-container">
@@ -1163,24 +1163,24 @@ <h4>Declaration</h4>
11631163
<li class="item">
11641164
<div>
11651165
<code>
1166-
<a name="/s:FC22UICircularProgressRing26UICircularProgressRingView26prepareForInterfaceBuilderFT_T_"></a>
1167-
<a name="//apple_ref/swift/Method/prepareForInterfaceBuilder()" class="dashAnchor"></a>
1168-
<a class="token" href="#/s:FC22UICircularProgressRing26UICircularProgressRingView26prepareForInterfaceBuilderFT_T_">prepareForInterfaceBuilder()</a>
1166+
<a name="/s:FC22UICircularProgressRing26UICircularProgressRingView4drawFVSC6CGRectT_"></a>
1167+
<a name="//apple_ref/swift/Method/draw(_:)" class="dashAnchor"></a>
1168+
<a class="token" href="#/s:FC22UICircularProgressRing26UICircularProgressRingView4drawFVSC6CGRectT_">draw(_:)</a>
11691169
</code>
11701170
</div>
11711171
<div class="height-container">
11721172
<div class="pointer-container"></div>
11731173
<section class="section">
11741174
<div class="pointer"></div>
11751175
<div class="abstract">
1176-
<p>Prepares to draw the view for use with interface builder</p>
1176+
<p>Overriden because of custom layer drawing in UICircularProgressRingLayer</p>
11771177

11781178
</div>
11791179
<div class="declaration">
11801180
<h4>Declaration</h4>
11811181
<div class="language">
11821182
<p class="aside-title">Swift</p>
1183-
<pre class="highlight"><code><span class="n">open</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">prepareForInterfaceBuilder</span><span class="p">()</span></code></pre>
1183+
<pre class="highlight"><code><span class="n">open</span> <span class="k">override</span> <span class="kd">func</span> <span class="nf">draw</span><span class="p">(</span><span class="n">_</span> <span class="nv">rect</span><span class="p">:</span> <span class="kt">CGRect</span><span class="p">)</span></code></pre>
11841184

11851185
</div>
11861186
</div>
Binary file not shown.
-12 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)