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

Commit 476a8b7

Browse files
author
Luis Padron
committed
Update README, CHANGELOG, and podspec. Rerun jazzy, updated docs
1 parent 3461b37 commit 476a8b7

21 files changed

+928
-108
lines changed

CHANGELOG.md

+27-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
1-
# Version 1.4.3 (latest)
1+
# Version 1.5.0 (latest)
2+
3+
#### Highlight: Major refactoring and making properties safer/easier to use.
4+
5+
- Refactored the `ringStyle` property to `ibRingStyle` and made unavailable for use with code (see below)
6+
- Refactored `outerRingCapStyle`, and `innerRingCapStyle` into new properties and made them unavailable for code use. As these properties will only be used for interface builder, while I patiently wait for Apple to allow enums in IBInspectable properties
7+
- Added new `ringStyle` which uses new type `UICircularProgressRingStyle` enum to make it easier and safer to assign a style to the progress ring
8+
- Added new `outCapStyle` and `inCapStyle` enum properties of type `CGCapStyle` which again, allow for easer and safer assignment of progress ring cap styles in code.
9+
- Refactored most of the source code to maintain a max line width of 80, cause I'm insane like that
10+
- Updated documentation
11+
12+
##### Breaking Changes in 1.5.0
13+
14+
Due to the refactoring, any code which previously used these properties will have to use the new enumerations provided (sorry).
15+
16+
Also, since the `ringStyle` property was changed to `ibRingStyle` then any customized ring style inside of Interface Builder will need to be updated to use the new property, you may see a warning from interface builder. To fix these warnings: Go into the class inspector of the view, under `User Defined Run Time Attributes` remove any of the `ringStyle` values. Then refresh the views by doing `Editor -> Refresh Views`
17+
18+
19+
20+
# Version 1.4.3
221

322
- Fix deprecation warning in new Xcode version from using `M_PI`
423

524
# Version 1.4.2
625

7-
- Add new `fullCircle` property to the `UICircularProgressRingView`. Which removes the confusion of setting a valid end angle. For example previously if you wanted a full circle and you wanted the progress to start from the top you could do `startAngle = -90` however this would also require you to subtract 90 from the end angle, since the default is 360. This was not fully understood by some users. Now you have the option using `fullCircle` to set and forget the `startAngle` and the `endAngle` will automagically be corrected for you, thus always giving you a full circle with your desired start ange.
26+
- Add new `fullCircle` property to the `UICircularProgressRingView`. Which removes the confusion of setting a valid end angle. For example previously if you wanted a full circle and you wanted the progress to start from the top you could do `startAngle = -90` however this would also require you to subtract 90 from the end angle, since the default is 360. This was not fully understood by some users. Now you have the option using `fullCircle` to set and forget the `startAngle` and the `endAngle` will automagically be corrected for you, thus always giving you a full circle with your desired start angle.
827
- Update some Xcode unit tests
928
- Update documentation to include new `fullCircle` property
1029

@@ -18,7 +37,7 @@ With the addition of the `fullCircle` property which is `true` by default anyone
1837

1938
#### Breaking API Changes in 1.4.1
2039

21-
Nothing really, but previously if you had not set the `valueIndicator` property then there would be no value indicator shown to the right of the value. This was not inteded and has been fixed in this release. If you prefer to have no value indicator, you must now explicitly set the property to empty
40+
Nothing really, but previously if you had not set the `valueIndicator` property then there would be no value indicator shown to the right of the value. This was not intended and has been fixed in this release. If you prefer to have no value indicator, you must now explicitly set the property to empty
2241

2342
```swift
2443
ring.valueIndicator = ""
@@ -37,7 +56,7 @@ ring.valueIndicator = ""
3756

3857
__Why was this done?__
3958

40-
This made sense to do because it was slightly confusing how to accomplish fonts and interface builder since apple does not add support for `IBDesignable` fonts. I've decided to sacrifice the interface builder support for code only font management, because this leads to safer use of fonts since the view is no longer handeling the creation of `UIFont` itself. This also adds more customization to the view since previously you could only change the font size and font. Now users can do whatever is allowed with UIFont, such as using defined font families, etc.
59+
This made sense to do because it was slightly confusing how to accomplish fonts and interface builder since apple does not add support for `IBDesignable` fonts. I've decided to sacrifice the interface builder support for code only font management, because this leads to safer use of fonts since the view is no longer handleing the creation of `UIFont` itself. This also adds more customization to the view since previously you could only change the font size and font. Now users can do whatever is allowed with UIFont, such as using defined font families, etc.
4160

4261
# Version 1.3.0
4362

@@ -73,10 +92,10 @@ This made sense to do because it was slightly confusing how to accomplish fonts
7392

7493
# Version 1.1.8
7594

76-
- Remove overriden `draw(rect:)` method to avoid any issues with performance and iOS drawing
95+
- Remove overridden `draw(rect:)` method to avoid any issues with performance and iOS drawing
7796
- Implemented `prepareForInterfaceBuilder` to still allow for IB designing
7897

79-
- Remove strong refrence to delegate
98+
- Remove strong reference to delegate
8099
- UICircularProgressRingDelegate is now a class protocol
81100
- UICircularProgressRingDelegate inside of UICircularProgressRingView is now weak to avoid retain cycle
82101

@@ -96,12 +115,12 @@ Thanks to [@DeepAnchor](https://github.com/DeepAnchor) for the fix!
96115

97116
Lower required iOS version to iOS 8.0
98117

99-
- Lower podspec for compatability with iOS 8.0
118+
- Lower podspec for compatibility with iOS 8.0
100119
- Lower project deployment target to 8.0
101120

102121
# Version 1.1.5
103122

104-
Fix inaccesible ring value thanks to [@DaveKim](https://github.com/davekim)
123+
Fix inaccessible ring value thanks to [@DaveKim](https://github.com/davekim)
105124

106125
- Update delegate method parameters for more Swift like method names/parameters
107126
- Update Xcode project to recommended settings

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
![Banner](/.github/banner.png)
1+
![Banner](https://raw.githubusercontent.com/luispadron/UICircularProgressRing/master/.github/banner.png)
22

33
<h3 align="center">A circular progress bar for iOS written in Swift 3</h3>
44

55
<p align="center">
6-
<img src="/.github/demo.gif"/>
6+
<img src="https://raw.githubusercontent.com/luispadron/UICircularProgressRing/master/.github/demo.gif"/>
77
</p>
88

9-
![Styles](/.github/styles-banner.png)
9+
![Styles](https://raw.githubusercontent.com/luispadron/UICircularProgressRing/master/.github/styles-banner.png)
1010

11-
### Looking for people to help maintain and contribute, email me [here](mailto:[email protected])
11+
### _Looking for awesome people to help maintain and contribute_
1212

1313
## Features
1414

@@ -78,7 +78,7 @@ Simply drag a `UIView` into your storyboard. Make sure to subclass `UICircularPr
7878

7979
Design your heart out
8080

81-
![ib-demo.gif](/.github/ib-demo.gif)
81+
![ib-demo.gif](https://raw.githubusercontent.com/luispadron/UICircularProgressRing/master/.github/ib-demo.gif)
8282

8383
### Code
8484

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.4.3"
5+
s.version = "1.5.0"
66
s.summary = "A highly customizable circular progress bar for iOS written in Swift 3"
77

88
s.description = <<-DESC

docs/Classes.html

+8
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@
5757
</li>
5858
</ul>
5959
</li>
60+
<li class="nav-group-name">
61+
<a class="nav-group-name-link" href="Enums.html">Enums</a>
62+
<ul class="nav-group-tasks">
63+
<li class="nav-group-task">
64+
<a class="nav-group-task-link" href="Enums/UICircularProgressRingStyle.html">UICircularProgressRingStyle</a>
65+
</li>
66+
</ul>
67+
</li>
6068
<li class="nav-group-name">
6169
<a class="nav-group-name-link" href="Protocols.html">Protocols</a>
6270
<ul class="nav-group-tasks">

docs/Classes/UICircularProgressRingView.html

+33-43
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858
</li>
5959
</ul>
6060
</li>
61+
<li class="nav-group-name">
62+
<a class="nav-group-name-link" href="../Enums.html">Enums</a>
63+
<ul class="nav-group-tasks">
64+
<li class="nav-group-task">
65+
<a class="nav-group-task-link" href="../Enums/UICircularProgressRingStyle.html">UICircularProgressRingStyle</a>
66+
</li>
67+
</ul>
68+
</li>
6169
<li class="nav-group-name">
6270
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
6371
<ul class="nav-group-tasks">
@@ -329,31 +337,24 @@ <h3 class="section-name">View Style</h3>
329337
<li class="item">
330338
<div>
331339
<code>
332-
<a name="/s:vC22UICircularProgressRing26UICircularProgressRingView9viewStyleSi"></a>
333-
<a name="//apple_ref/swift/Property/viewStyle" class="dashAnchor"></a>
334-
<a class="token" href="#/s:vC22UICircularProgressRing26UICircularProgressRingView9viewStyleSi">viewStyle</a>
340+
<a name="/s:vC22UICircularProgressRing26UICircularProgressRingView9ringStyleOS_27UICircularProgressRingStyle"></a>
341+
<a name="//apple_ref/swift/Property/ringStyle" class="dashAnchor"></a>
342+
<a class="token" href="#/s:vC22UICircularProgressRing26UICircularProgressRingView9ringStyleOS_27UICircularProgressRingStyle">ringStyle</a>
335343
</code>
336344
</div>
337345
<div class="height-container">
338346
<div class="pointer-container"></div>
339347
<section class="section">
340348
<div class="pointer"></div>
341349
<div class="abstract">
342-
<p>Variable for the style of the progress ring.</p>
343-
344-
<p>Range: [1,4]</p>
350+
<p>The style of the progress ring.</p>
345351

346-
<p>The four styles are</p>
352+
<p>Type: <code><a href="../Enums/UICircularProgressRingStyle.html">UICircularProgressRingStyle</a></code></p>
347353

348-
<ul>
349-
<li>1: Radius of the inner ring is smaller (inner ring inside outer ring)</li>
350-
<li>2: Radius of inner ring is equal to outer ring (both at same location)</li>
351-
<li>3: Radius of inner ring is equal to outer ring, and the outer ring is dashed</li>
352-
<li>4: Radius of inner ring is equal to outer ring, and the outer ring is dotted</li>
353-
</ul>
354+
<p>The four styles include <code>inside</code>, <code>ontop</code>, <code>dashed</code>, <code>dotted</code></p>
354355
<h2 id='important' class='heading'>Important</h2>
355356

356-
<p>Default = 1</p>
357+
<p>Default = UICircularProgressRingStyle.inside</p>
357358
<h2 id='author' class='heading'>Author:</h2>
358359

359360
<p>Luis Padron</p>
@@ -363,7 +364,7 @@ <h2 id='author' class='heading'>Author:</h2>
363364
<h4>Declaration</h4>
364365
<div class="language">
365366
<p class="aside-title">Swift</p>
366-
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="n">open</span> <span class="k">var</span> <span class="nv">viewStyle</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">1</span></code></pre>
367+
<pre class="highlight"><code><span class="n">open</span> <span class="k">var</span> <span class="nv">ringStyle</span><span class="p">:</span> <span class="kt"><a href="../Enums/UICircularProgressRingStyle.html">UICircularProgressRingStyle</a></span> <span class="o">=</span> <span class="o">.</span><span class="n">inside</span></code></pre>
367368

368369
</div>
369370
</div>
@@ -559,28 +560,24 @@ <h4>Declaration</h4>
559560
<li class="item">
560561
<div>
561562
<code>
562-
<a name="/s:vC22UICircularProgressRing26UICircularProgressRingView17outerRingCapStyleSi"></a>
563-
<a name="//apple_ref/swift/Property/outerRingCapStyle" class="dashAnchor"></a>
564-
<a class="token" href="#/s:vC22UICircularProgressRing26UICircularProgressRingView17outerRingCapStyleSi">outerRingCapStyle</a>
563+
<a name="/s:vC22UICircularProgressRing26UICircularProgressRingView13outerCapStyleOSC9CGLineCap"></a>
564+
<a name="//apple_ref/swift/Property/outerCapStyle" class="dashAnchor"></a>
565+
<a class="token" href="#/s:vC22UICircularProgressRing26UICircularProgressRingView13outerCapStyleOSC9CGLineCap">outerCapStyle</a>
565566
</code>
566567
</div>
567568
<div class="height-container">
568569
<div class="pointer-container"></div>
569570
<section class="section">
570571
<div class="pointer"></div>
571572
<div class="abstract">
572-
<p>The style for the outer ring end cap (how it is drawn on screen)
573-
Range [1,3]</p>
574-
575-
<ul>
576-
<li>1: Line with a squared off end</li>
577-
<li>2: Line with a rounded off end</li>
578-
<li>3: Line with a square end</li>
579-
<li><1 & >3: Defaults to style 1</li>
580-
</ul>
573+
<p>The style for the tip/cap of the outer ring</p>
574+
575+
<p>Type: <code>CGLineCap</code></p>
581576
<h2 id='important' class='heading'>Important</h2>
582577

583-
<p>Default = 1</p>
578+
<p>Default = CGLineCap.butt</p>
579+
580+
<p>This is only noticible when ring is not a full circle.</p>
584581
<h2 id='author' class='heading'>Author:</h2>
585582

586583
<p>Luis Padron</p>
@@ -590,7 +587,7 @@ <h2 id='author' class='heading'>Author:</h2>
590587
<h4>Declaration</h4>
591588
<div class="language">
592589
<p class="aside-title">Swift</p>
593-
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="n">open</span> <span class="k">var</span> <span class="nv">outerRingCapStyle</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">1</span></code></pre>
590+
<pre class="highlight"><code><span class="n">open</span> <span class="k">var</span> <span class="nv">outerCapStyle</span><span class="p">:</span> <span class="kt">CGLineCap</span> <span class="o">=</span> <span class="o">.</span><span class="n">butt</span></code></pre>
594591

595592
</div>
596593
</div>
@@ -712,29 +709,22 @@ <h4>Declaration</h4>
712709
<li class="item">
713710
<div>
714711
<code>
715-
<a name="/s:vC22UICircularProgressRing26UICircularProgressRingView17innerRingCapStyleSi"></a>
716-
<a name="//apple_ref/swift/Property/innerRingCapStyle" class="dashAnchor"></a>
717-
<a class="token" href="#/s:vC22UICircularProgressRing26UICircularProgressRingView17innerRingCapStyleSi">innerRingCapStyle</a>
712+
<a name="/s:vC22UICircularProgressRing26UICircularProgressRingView13innerCapStyleOSC9CGLineCap"></a>
713+
<a name="//apple_ref/swift/Property/innerCapStyle" class="dashAnchor"></a>
714+
<a class="token" href="#/s:vC22UICircularProgressRing26UICircularProgressRingView13innerCapStyleOSC9CGLineCap">innerCapStyle</a>
718715
</code>
719716
</div>
720717
<div class="height-container">
721718
<div class="pointer-container"></div>
722719
<section class="section">
723720
<div class="pointer"></div>
724721
<div class="abstract">
725-
<p>The style for the inner ring end cap (how it is drawn on screen)</p>
726-
727-
<p>Range [1,3]</p>
722+
<p>The style for the tip/cap of the inner ring</p>
728723

729-
<ul>
730-
<li>1: Line with a squared off end</li>
731-
<li>2: Line with a rounded off end</li>
732-
<li>3: Line with a square end</li>
733-
<li><1 & >3: Defaults to style 2</li>
734-
</ul>
724+
<p>Type: <code>CGLineCap</code></p>
735725
<h2 id='important' class='heading'>Important</h2>
736726

737-
<p>Default = 2</p>
727+
<p>Default = CGLineCap.round</p>
738728
<h2 id='author' class='heading'>Author:</h2>
739729

740730
<p>Luis Padron</p>
@@ -744,7 +734,7 @@ <h2 id='author' class='heading'>Author:</h2>
744734
<h4>Declaration</h4>
745735
<div class="language">
746736
<p class="aside-title">Swift</p>
747-
<pre class="highlight"><code><span class="kd">@IBInspectable</span> <span class="n">open</span> <span class="k">var</span> <span class="nv">innerRingCapStyle</span><span class="p">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="mi">2</span></code></pre>
737+
<pre class="highlight"><code><span class="n">open</span> <span class="k">var</span> <span class="nv">innerCapStyle</span><span class="p">:</span> <span class="kt">CGLineCap</span> <span class="o">=</span> <span class="o">.</span><span class="n">round</span></code></pre>
748738

749739
</div>
750740
</div>

0 commit comments

Comments
 (0)