- Fix issue with value knob being clipped for certain ring styles
- Add Swift Package Manager support
- Add new "knob" related features, such as custom knob paths and ability to add images to the progress ring knob. Thanks to @Tom Knapen for the PR!
- Fix border width calculation to allow proper fitting of view within given bounds. Thanks to @zulkis for the PR.
- Adds ability to start the timer ring from a value other than 0.
- Migrate to Swift 5.0, thanks to darecki for the PR!
- Fix issue with formatter initializers being interal, they're now public as intended.
- Fix bug relating to label for rings being removed during animation (#171)
- Fixed issue with API of
UICircularRingStyle
which made it impossible to have both a gradient and outer ring style, etc. - Refactor way that
UICircularRingValueFormatter
works. It's now a simple protocol which anyone can conform to. There are two concrete implementations from 5.0.0 which can still be used, however, they're nowstruct
s so cannot be mutated.
- Due to the fact that both the
.style
property now doesnt allow setting.gradient
, this API has been broken. Instead, use the new.gradientOptions
property to set a gradient, and.style
if you need extra styling on top of gradient - Because the value formatter are now structs, they cannot be modified with
.
syntax. Instead create a brand new formatter and assign to the.valueFormatter
property. This will be over all much better in the future, less state and structs are cool!
wow bug fixes already?
- Fixed issue with timing function for timer ring not being set properly
- Rethink how the timer handler notifies about state, checkout
UICircularTimerRing.State
- New
UICircularTimerRing
view! - Complete API overhaul
- Refactored the
UICircularProgressRing
class into two classes, a new base classUICircularRing
and the concrete implementationUICircularProgressRing
. - Added new
UICircularTimerRing
view which allows setting a timer, pausing, continuing etc. Without worrying about formatting the value string, get accurate time, etc. - Almost the entire code and API has been refactored
- Add new
UICircularRingValueFormatter
for much nicer handling of formatting values for both views - Add new
UICircularGradientOptions
and updatedUICircularRingStyle
to be much more "swifty" in order to use case stored properties. - Removed a ton of duplicated code between layer and actual ring class, no longer using a ton of
@NSManaged
properties, instead the layer asks the ring for the needed values. This looks much nicer.
- Fixed issue with gradient style not having the correct radius and thus clipping
- Fixed issues with border clipping in some cases
- Removed most Objective-C support, because being forced to write nice, new and maintainable code for both Swift and Objective-C has led to issues with adding new features, and its just not feasible if I want to be able to maintain and do cool things with this project. It sucks in terms of backwards compatibility but in the long run I think it'll be worth it.
- Removed a ton of
@IBInspectable
properties, a lot of these likeringStyle
behaved really badly, they required using some sort of integer and then converting that into the actualenum
type for the ring style, all properties that had this issue have been removed. Until Apple adds support for enum, or more complex properties I'll only be providing IB support for the basic properties of the ring. - A lot of API changes were done to the styling of the ring, take a look at the docs, specifically
UICircularRingStyle
,UICircularGradientOptions
, andUICircularRingValueFormatter
.
I expect the migration to be painful, I'm very sorry! I felt that the only way to keep this library going into the future was to completely overhaul and update the API and underlying code. This has obviously led to breaking just about everything, again, I'm sorry.
Some tips:
- If you were using interface builder, take a look at the docs for
UICircularRing
andUICircularProgressRing
. A lot of@IBInspectable
properties have been removed/renamed. If these were set in your storyboards/xibs, they will be broken and must be removed from the views settings in IB. - Complex styling options are now done in code, with
.style
,.valueFormatter
and optionally.valueKnobStyle
. Take a look at the docs to learn more.
- Fix issues with border drawing and crashes related to it. Thanks to @abdulla-allaith for the PR!
- Migrate to Swift 4.2, thanks to @chirs-redbeed for initial migration
- Rename
animationStyle
toanimationTimingFunction
. Now uses newCAMediaTimingFunctionName
enum instead of unsafe String.
- Add check for
value
being set greater thanmaxValue
Thanks to @byronsalty for the PR!
- Fixes more issues with pause/continue progress logic. Thanks to @nickdnk for the PR!
-
Fixes issues with inconsisten API. The
pauseProgress()
andresetProgress()
now work as expeted/intended. When callingpauseProgress()
, the completion on thestartProgress
function wont be called until it's actually been completed. When callingresetProgress
the completion forstartProgress
is discarded and will no longer be called, since the ring has not actually completed (same with delegate).Thanks a lot to @MileyHollenberg for these fixes!
- Add new ring style
bordered
thanks to @abdulla-allaith!
- Adds three new properties for more fine grained control of the
progress knob.
valueKnobShadowBlur
,valueKnobShadowOffset
, andvalueKnobShadowColor
. Thanks to @xismic for the contribution!
- Add new properties
showsValueKnob
,valueKnobColor
, andvalueKnobSize
as requested by #97 - Add new
continueProgress
andpauseProgress
functions which allow fluid continuation and pausing of progress animations. - Add new delegate functions
didPauseProgress
, anddidContinueProgress
- Tons of refactoring and renaming of properties/functionality
Lots please refer to the documentation to get your code up to spec with version 3.0.0
- Add new
isClockwise
property which allows users of the library to set whether or not the ring should rotate in a clockwise fashion.
Thanks to @petewalker for adding this!
- Add example playground, remove old example workspace
- Enable app-extension safe API
- Build with Swift 4.1.2
Add right-to-left language support, thanks eladhayun.
- New property
rightToLeft
which when set to true will display the ring with RTL language support, for example whenrightToLeft = true
, the progress will beGB 100
instead of100 GB
.
Add feature requested in #86 and general clean up and refactoring of API.
- Add new
ring
paramater to functionsdidUpdateProgressValue
andwillDisplayLabel
so that they can be used with multiple rings if needed.
finishedUpdatingProgress(forRing:)
now changed tofinishedUpdatingProgress(for:)
didUpdateProgressValue(to:)
now changed todidUpdateProgressValue(for:to:)
willDisplayLabel(label:)
now changed towillDisplayLabel(for:_:)
setProgress(value:animationDuration:completion:)
now changed tosetProgress(to:duration:completion:)
- Build project with Swift 4.1
- Mark delegate methods as
@objc optional
to allow default or optional conformance, thanks to @AbelToy
- Fix issue with
@objc
and newwillDisplayLabel
method inUICircularProgressRingDelegate
.
- Add ability to modify ring label before drawing, thanks to @hohteri
- Fix bug with not checking
shouldAnimateProperties
in the progress ring layer.
Add new animateProperties(duration:animations:completion:)
method.
This allows you to animate any of the animatable properties of the UICircularProgressRing
, which currently are: innerRingColor
, innerRingWidth
, outerRingColor
, outerRingWidth
, innerRingSpacing
, fontColor
.
Example usage:
self.ring.animateProperties(duration: 1.5) {
// Animate things here
self.ring.innerRingColor = .purple
self.ring.outerRingColor = .blue
}
Add Objective-C support, thanks to @hohteri
Add Carthage Interface Builder support, thanks to @AbelToy.
- Add fix for progress ring requiring square frame
- Fix issue where height was set to width.
- Use min between height and width to calculate radius for both outer and inner ring
- Code optimization & Added missing test cases
- Refactored test cases to also test UICircularProgressRingLayer.
- Add missing test cases for new gradient members.
- Add explicit typing to local variables in order to speed up compilation.
- Add new Swift compiler flags to warn about long function/type inference compilation.
- Improved calculations for inner ring angle.
- Thanks to @jeffro256 for committing.
- Add
s.ios.deployment_target = "8.0"
to Podspec, thanks to @younatics
- Fix issue where outer ring width couldn't be smaller than inner ring width. Thanks to: SwiftTsubame for the contribution.
- Add ability to set a range of values for the ring, unlike before where only
maxValue
could be set. You can now use the newminValue
to specify a range that the value can fall between. Read the docs to learn about any issues that may arise with setting avalue
less thanminValue
. - Fixed bugs related to how many degrees the inner ring for the progress ring draws. Everything should exact now even if not using the
fullCircle
property. - Fixed a bug which allowed setting a
value
less than zero. Read the docs to learn why this was an issue. - Refactored some unused code and tidied things up a bit
- Regenerated documentation using Jazzy
- New method in
UICircularProgressRingDelegate
,didUpdateProgressValue(to newValue: CGFloat)
, which can be used to get notified of value changes to the progress ring in real time. As the documentation states, this is a very hot method and it may be called hundreds of times per second, thus only very minimal work should be performed in this method.
- Make sure
.swift-version
is included in pod, in order to fix issue with Xcode 9
- Updated project settings to recommended Xcode settings
- Updated language to Swift 4
- Updated
@objc inference
todefault
- Added new progress ring style
gradient
which allows for drawing a gradient inner ring given some colors. - Added 4 new properties to
UICircularProgressRingView
which are used to determine the look of the gradient when drawing - Added new enumeration type
UICircularProgressRingGradientPosition
to determine position of gradient for drawing purposes - Updated docs to reflect these new changes
None!
- Refactored the
ringStyle
property toibRingStyle
and made unavailable for use with code (see below) - Refactored
outerRingCapStyle
, andinnerRingCapStyle
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 - Added new
ringStyle
which uses new typeUICircularProgressRingStyle
enum to make it easier and safer to assign a style to the progress ring - Added new
outCapStyle
andinCapStyle
enum properties of typeCGCapStyle
which again, allow for easer and safer assignment of progress ring cap styles in code. - Refactored most of the source code to maintain a max line width of 80, cause I'm insane like that
- Updated documentation
Due to the refactoring, any code which previously used these properties will have to use the new enumerations provided (sorry).
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
- Fix deprecation warning in new Xcode version from using
M_PI
- Add new
fullCircle
property to theUICircularProgressRingView
. 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 dostartAngle = -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 usingfullCircle
to set and forget thestartAngle
and theendAngle
will automagically be corrected for you, thus always giving you a full circle with your desired start angle. - Update some Xcode unit tests
- Update documentation to include new
fullCircle
property
With the addition of the fullCircle
property which is true
by default anyone who was using a non-circular progress ring will see that their progress ring is now circular. To fix this either set fullCircle
to false
via code or go into interface builder and toggle Full Circle
to Off
.
- Fix bug where the default
valueIndicator
'%' - was not set on initialization
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
ring.valueIndicator = ""
- Remove the
fontSize
andcustomFontWithName
properties - Add new
font
property of typeUIFont
to handle all font related configuration - Update documentation to include changes
- Since no longer using
fontSize
orcustomFontWithName
any projects using these properties will break until updated to newerfont
and to useUIFont
. - Any interface builder views which used
fontSize
orcustomFontWithName
will now complain about breaking. To fix this simply go into the class inspector of the view, underUser Defined Run Time Attributes
remove any of thefontSize
orcustomFontWithName
values. Then refresh the views by doingEditor -> Refresh Views
Why was this done?
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.
- Add a property for accessing the current value of the progress ring while animating, closes issue #14
- Add fix for removing a currently running animation when calling
setProgress(:)
while ring is animating, closes issue #19 - Fixed access levels for variables and functions, changed from
public
toopen
to allow subclassing. - Updated
docs
by running Jazzy
- Remove useless print statements from guards
- Fix line dash property when using
viewStyle = 3
not being set properly, thanks to RomainBSQT.
- Default completion handler to nil for
setProgress(:)
- Fix issue with module version number, now actually supports iOS 8
- Added some basic tests for right now
- Refactor some comments
- Remove
private
access, set tointernal
for unit testing - Fix default with inCapStyle being sett to wrong value
- Revert back to using
draw(rect:)
as was having issues with nib loaded views? - Change class of UICircularProgressRingLayer from
CALayer
toCAShapeLayer
-
Remove overridden
draw(rect:)
method to avoid any issues with performance and iOS drawing- Implemented
prepareForInterfaceBuilder
to still allow for IB designing
- Implemented
-
Remove strong reference to delegate
- UICircularProgressRingDelegate is now a class protocol
- UICircularProgressRingDelegate inside of UICircularProgressRingView is now weak to avoid retain cycle
- UICircularProgressRingDelegate is now a
protocol: class
can only be used onclass
types
Fix bug where progress bar was pixelated inside of tableView from issue #4
Thanks to @DeepAnchor for the fix!
- Default background color for view and layer is now of
UIColor.clear
Lower required iOS version to iOS 8.0
- Lower podspec for compatibility with iOS 8.0
- Lower project deployment target to 8.0
Fix inaccessible ring value thanks to @DaveKim
- Update delegate method parameters for more Swift like method names/parameters
- Update Xcode project to recommended settings
Delegate method renamed to: func finishedUpdatingProgress(forRing ring: UICircularProgressRingView)
(this is the last time, I swear)
Add isAnimating to UICircularProgressRingView
- Added new property to determine whether ring is animating currently
- Fix some typos
- Made completion handler default to nil
- Refactor delegate method call to look more Swifty
Delegate method renamed to: func finishedUpdatingProgress(forRing: UICircularProgressRingView)
- Refactor code into two separate files (UICircularProgressRingView, and UICircularProgressRingLayer)
- Fix animation, now works smoothly both increasing and decreasing
- More stability in terms of not causing a crash due to RunLoop
- More documentation
- ITS READY