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

Commit

Permalink
Revert back to using draw(rect:)
Browse files Browse the repository at this point in the history
- Remove prepareForStoryboard
- Add back draw(rec:) method
- Switch layer class of UICircularProgressRingLayer to CAShapeLayer
- Reran jazzy for docs
- Update CHANGELOG
  • Loading branch information
Luis Padron authored and Luis Padron committed Jan 21, 2017
1 parent 270c9f0 commit c117021
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 32 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion UICircularProgressRing.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions UICircularProgressRing/UICircularProgressRingLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
11 changes: 5 additions & 6 deletions UICircularProgressRing/UICircularProgressRingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
}


Expand Down
2 changes: 1 addition & 1 deletion docs/Classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h1>Classes</h1>
<p>This is the UIView subclass that creates and handles everything
to do with the progress ring</p>

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

<p>The properties in this class correspond with the properties in UICircularProgressRingLayer.
Expand Down
20 changes: 10 additions & 10 deletions docs/Classes/UICircularProgressRingView.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h1>UICircularProgressRingView</h1>
<p>This is the UIView subclass that creates and handles everything
to do with the progress ring</p>

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

<p>The properties in this class correspond with the properties in UICircularProgressRingLayer.
Expand Down Expand Up @@ -1061,10 +1061,10 @@ <h4>Declaration</h4>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/CALayer"></a>
<a name="//apple_ref/swift/Section/CALayer" class="dashAnchor"></a>
<a href="#/CALayer">
<h3 class="section-name">CALayer</h3>
<a name="/Layer"></a>
<a name="//apple_ref/swift/Section/Layer" class="dashAnchor"></a>
<a href="#/Layer">
<h3 class="section-name">Layer</h3>
</a>
</div>
<ul class="item-container">
Expand Down Expand Up @@ -1163,24 +1163,24 @@ <h4>Declaration</h4>
<li class="item">
<div>
<code>
<a name="/s:FC22UICircularProgressRing26UICircularProgressRingView26prepareForInterfaceBuilderFT_T_"></a>
<a name="//apple_ref/swift/Method/prepareForInterfaceBuilder()" class="dashAnchor"></a>
<a class="token" href="#/s:FC22UICircularProgressRing26UICircularProgressRingView26prepareForInterfaceBuilderFT_T_">prepareForInterfaceBuilder()</a>
<a name="/s:FC22UICircularProgressRing26UICircularProgressRingView4drawFVSC6CGRectT_"></a>
<a name="//apple_ref/swift/Method/draw(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC22UICircularProgressRing26UICircularProgressRingView4drawFVSC6CGRectT_">draw(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Prepares to draw the view for use with interface builder</p>
<p>Overriden because of custom layer drawing in UICircularProgressRingLayer</p>

</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<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>
<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>

</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h1>Classes</h1>
<p>This is the UIView subclass that creates and handles everything
to do with the progress ring</p>

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

<p>The properties in this class correspond with the properties in UICircularProgressRingLayer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ <h1>UICircularProgressRingView</h1>
<p>This is the UIView subclass that creates and handles everything
to do with the progress ring</p>

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

<p>The properties in this class correspond with the properties in UICircularProgressRingLayer.
Expand Down Expand Up @@ -1061,10 +1061,10 @@ <h4>Declaration</h4>
</div>
<div class="task-group">
<div class="task-name-container">
<a name="/CALayer"></a>
<a name="//apple_ref/swift/Section/CALayer" class="dashAnchor"></a>
<a href="#/CALayer">
<h3 class="section-name">CALayer</h3>
<a name="/Layer"></a>
<a name="//apple_ref/swift/Section/Layer" class="dashAnchor"></a>
<a href="#/Layer">
<h3 class="section-name">Layer</h3>
</a>
</div>
<ul class="item-container">
Expand Down Expand Up @@ -1163,24 +1163,24 @@ <h4>Declaration</h4>
<li class="item">
<div>
<code>
<a name="/s:FC22UICircularProgressRing26UICircularProgressRingView26prepareForInterfaceBuilderFT_T_"></a>
<a name="//apple_ref/swift/Method/prepareForInterfaceBuilder()" class="dashAnchor"></a>
<a class="token" href="#/s:FC22UICircularProgressRing26UICircularProgressRingView26prepareForInterfaceBuilderFT_T_">prepareForInterfaceBuilder()</a>
<a name="/s:FC22UICircularProgressRing26UICircularProgressRingView4drawFVSC6CGRectT_"></a>
<a name="//apple_ref/swift/Method/draw(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:FC22UICircularProgressRing26UICircularProgressRingView4drawFVSC6CGRectT_">draw(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Prepares to draw the view for use with interface builder</p>
<p>Overriden because of custom layer drawing in UICircularProgressRingLayer</p>

</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<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>
<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>

</div>
</div>
Expand Down
Binary file not shown.
Binary file modified docs/docsets/UICircularProgressRing.tgz
Binary file not shown.

0 comments on commit c117021

Please sign in to comment.