76 Commits

Author SHA1 Message Date
Brandon McQuilkin 2ca59b59b3 Forgot to change source tag. 2016-11-10 07:54:56 -05:00
Brandon McQuilkin 5a13d866b8 Updated pod spec version after merging multiple pull requests. 2016-11-10 07:53:41 -05:00
Brandon McQuilkin 5927f8faaa Merge pull request #113 from ilyavelilyaev/master
Added ability to set custom background color to UINavigationBar progress bar.
2016-11-10 07:50:16 -05:00
Brandon McQuilkin e6b7550d5e Merge pull request #110 from algrid/fix-67
Update _backgroundLayer.lineWidth on borderWidth change in striped bar
2016-11-10 07:44:41 -05:00
Brandon McQuilkin d46c8a6279 Merge pull request #109 from algrid/fix-grayscale
M13ProgressViewImage - fix createImageForCurrentProgress (types and g…
2016-11-10 07:44:05 -05:00
Brandon McQuilkin cee320a57d Merge pull request #108 from charlymr/master
Fixed #105
2016-11-10 07:43:28 -05:00
Brandon McQuilkin 63b422fac8 Merge pull request #106 from zanesc/master
Fixed M13ProgressHUD not updating own progress value when setProgre…
2016-11-10 07:42:56 -05:00
Ilya Velilyaev a2f4e8448d Fix unability to set clear background color 2016-11-03 14:01:11 +03:00
Ilya Velilyaev 8d97ac8b71 Added example 2016-11-03 13:59:18 +03:00
Ilya Velilyaev 8971d7493a fixed background color not setting 2016-11-03 13:48:52 +03:00
Ilya Velilyaev 93772f7a65 added background color to navigation bar progress view 2016-11-03 13:40:41 +03:00
Alexei Gridnev 148a116c73 Update _backgroundLayer.lineWidth on borderWidth change in striped bar 2016-10-27 02:07:41 +03:00
Alexei Gridnev 5c64775358 M13ProgressViewImage - fix createImageForCurrentProgress (types and grayscale calculation) 2016-10-26 01:20:23 +03:00
MARTIN Denis bb382e58bc Fixed #105
This should fixed the issue with the secondary color.
2016-10-19 10:56:44 +02:00
Zane Campbell 25348b780c - fixed M13ProgressHUD not updating own progress value when setProgress called 2016-10-07 05:02:14 -04:00
Brandon McQuilkin c89079d627 Fixed invalid context error: Issue #35 2016-08-10 08:21:55 -04:00
Brandon McQuilkin 31fec485e0 Fixed more Xcode warnings. 2016-08-10 08:18:27 -04:00
Brandon McQuilkin ab6ece6f29 Updated Podspec 2016-08-08 08:38:52 -04:00
Brandon McQuilkin b6a9f52057 Fixed several warnings. 2016-08-08 08:32:16 -04:00
Brandon McQuilkin 0020ab2eae Merge pull request #100 from BlueVirusX/master
Removed M13_APP_EXTENSIONS and fixed warnings
2016-08-08 08:02:36 -04:00
Brandon McQuilkin 645fcf238e Merge pull request #93 from jeremiescheer/master
Can center M13 progress HUD animation
2016-08-08 08:00:34 -04:00
Brandon McQuilkin c92b4390e2 Merge pull request #84 from sunkehappy/master
[Refactor Code] Add strong class cast to remove warnings.
2016-08-08 07:57:42 -04:00
Brandon McQuilkin 121ced54a8 Added basic usage to readme: Issue #96, #99 2016-08-07 10:56:05 -04:00
Brandon McQuilkin a0a1074379 Fixed compiler warnings: issue #52 2016-08-07 10:38:59 -04:00
BlueVirusX 5fa55e4125 Fixed framework product name
Fixed module warnings
2016-06-13 15:01:21 +02:00
BlueVirusX 894e60cfd9 Fix build break
Fix build break
2016-03-02 17:25:28 +01:00
BlueVirusX 2bcfe6fc5e Fixed warnings
Fixed warnings: Recommended project settings and cast of variable
2016-03-02 15:48:31 +01:00
BlueVirusX 9d6365c25b Removed M13_APP_EXTENSIONS
Removed M13_APP_EXTENSIONS and added [UIApplication
safeM13SharedApplication] and [UIApplication isM13AppExtension] because
then nobody needs to define M13_APP_EXTENSIONS
2016-03-02 15:47:25 +01:00
Jérémie SCHEER 5b2371819a Can center M13 progress HUD animation
Property to be able to center M13 progress HUD show and hide animation.
2015-11-10 17:08:47 +01:00
Calvin Sun 7b1a47024c [Refactor Code] Add strong class cast to remove warnings. 2015-09-24 13:12:57 +08:00
Brandon McQuilkin 71c237eec6 Merge pull request #82 from sunkehappy/patch-1
Remove one useless variable height
2015-09-13 14:23:13 -04:00
Calvin 53a3c25f91 Remove one useless variable height
The `height` variable is set but never used later in `UINavigationController+M13ProgressViewBar.m`. So I suggest to delete it currently. If we need this variable later, get the old logic from Git history.
2015-09-10 18:04:54 +08:00
Brandon McQuilkin 56f020ced6 Merge pull request #81 from mhaleem/master
Use Preprocessor Macro for App Extension target to avoid compile erro…
2015-09-07 18:55:20 -04:00
Mina 6000d1de0f Use Preprocessor Macro for App Extension target to avoid compile error due to [UIApplication sharedApplication].statusBarOrientation] - instead using simple solution based on Device size 2015-08-24 12:23:13 +02:00
Brandon McQuilkin cbfbb67581 Merge pull request #76 from qblu/master
Add support for carthage and dynamic frameworks
2015-08-11 18:29:38 -04:00
Brandon McQuilkin e2a9a7845c Merge pull request #72 from trunglee/master
Corner radius for progress view
2015-08-11 18:27:49 -04:00
Brandon McQuilkin 3431005616 Merge pull request #71 from harlanhaskins/master
Fixed progress width calculation
2015-08-11 18:26:51 -04:00
Rusty Zarse e0c35faea2 shared scheme again 2015-08-10 16:29:22 -04:00
Rusty Zarse 3e57c3d528 added framework support 2015-08-10 16:22:47 -04:00
Mike VanBeneden 140f453d7f Share scheme for Carthage support 2015-08-10 15:09:33 -04:00
Trung Lee dc822019d6 Corner radius for progress view
We want to customize corner radius for progress view. The corner radius
for progress view is dependent on progressViewThickness, it means we
can not customize it without changing progressViewThickness.
2015-07-20 11:38:04 +07:00
Harlan d3920a09a8 Fixed progress width calculation
Instead of using UIScreen, if possible use the topViewController's view property. This'll work much better if the view is within a UISplitViewController or if it's within a multitasking view on iOS 9.
2015-07-02 16:18:32 -04:00
Brandon McQuilkin 5665de3d54 Merge pull request #63 from benjerrim/patch-3
Update M13ProgressViewSegmentedRing.m
2015-05-18 11:36:26 -04:00
Brandon McQuilkin 58c502bd41 Merge pull request #69 from bojan/master
Xcode 6.3 compatibility fixes
2015-05-18 11:35:42 -04:00
Brandon McQuilkin 1b050b362b Merge pull request #61 from ianyh/master
Expose getIndeterminate in public API.
2015-05-18 11:34:36 -04:00
Bojan Dimovski c843d98f16 Remove the empty podfile. 2015-05-12 11:27:14 +02:00
Bojan Dimovski fe20de3392 Remove all files that should not be under source control. 2015-05-12 11:24:25 +02:00
Bojan Dimovski 1cd5dbec73 Replace the gitignore file with one including Xcode and Cocoapods files. 2015-05-12 11:20:45 +02:00
Bojan Dimovski 587609ab9d Update the image assets for the example project. 2015-05-12 11:18:56 +02:00
Bojan Dimovski d1e2d20b7b Remove a non-implemented method from the interface. 2015-05-12 11:12:32 +02:00
Bojan Dimovski c59c922d34 Fix a compiler warning. 2015-05-12 11:11:42 +02:00
Ben Jerrim 79f7523abd Update M13ProgressViewSegmentedRing.m
Fixed issue with unset Fill for primary colour
2015-03-01 11:50:53 +11:00
Ian Ynda-Hummel 57321a0f4a Expose getIndeterminate in public API. 2015-02-22 12:25:12 -05:00
Brandon McQuilkin 391e45172e Merge pull request #55 from Papercloud/issue/54
CADisplayLinks are removed by invalidating.
2015-02-14 18:38:13 -05:00
Mark Turner 3ced222828 CADisplayLinks are removed by invalidating rather than removing straight from run loop.
Resolves Marxon13/M13ProgressSuite#54
2015-01-21 18:03:44 +11:00
Marxon13 57cd39faf5 Addressed Issue #35 2014-12-12 23:04:30 -05:00
Brandon McQuilkin 040ce48aa7 Merge pull request #50 from ilidar/master
Fixed issue with hidden progress bar;
2014-11-24 16:19:24 -05:00
Denys Kotelovych 69f78a8aed Fixed issue with hidden progress bar; 2014-11-24 15:05:35 +02:00
Marxon13 8559bf8009 Updated pod spec again...
I can’t count…
2014-11-11 15:33:42 -05:00
Marxon13 35793527c2 Updated Podspec
I keep forgetting to do this…
2014-11-11 15:32:24 -05:00
Marxon13 efab7944b1 Added feature to segmented bar: Issue #49
Added the ability to give each segment a different color.
2014-11-11 15:30:48 -05:00
Brandon McQuilkin 4bc945e24f Merge pull request #47 from mohamedadly/master
- fix progressHUD to return top most HUD
2014-09-29 10:29:14 -04:00
madly 9b718a67c2 - fix progressHUD to return top most HUD 2014-09-15 15:23:20 +03:00
Brandon McQuilkin ccfc79f91c Merge pull request #43 from skydivedan/master
Changed “drawRect” of M13ProgressViewBar
2014-09-03 20:30:29 -04:00
Dan Morrow 10c375f74b changed “drawRect” so that if self.progress is 0, then we set the path of _progressLayer to nil. This will effectively “erase” progress. This is useful if M13ProgressViewBar is used in a reusable view, like a UITableViewCell. 2014-09-02 15:39:10 -04:00
Brandon McQuilkin e2df6b6210 Merge pull request #41 from hani-ibrahim/master
Fixing bugs
2014-08-29 09:43:51 -04:00
Hani Ibrahim 72a411a1f6 git ignore 2014-08-25 12:51:09 +03:00
Hani Ibrahim d78a949e91 fixing bug in M13ProgressViewRing
fixing bug in M13ProgressViewRing where backgroundRingWidth is not
working
2014-08-25 12:48:30 +03:00
Brandon McQuilkin 0cfae1e385 Merge pull request #40 from mkj-is/master
Fixes two Xcode 6 warnings
2014-08-16 11:47:23 -04:00
Matěj Kašpar Jirásek 59861e766c Fixes warning about NSCopying in Xcode 6 2014-08-15 16:50:27 +02:00
Matěj Kašpar Jirásek 3b158aa004 Fixes warning about incompatible types in Xcode 6 2014-08-15 16:49:53 +02:00
Brandon McQuilkin e90feadd11 Fixed Issue #34
Added Intrinsic content size for use with auto layout.
2014-07-17 11:55:46 -04:00
Brandon McQuilkin 98a2b35ccd Merge pull request #36 from jurysch/master
Clean up Xcode warnings, remove unused drawRect boilerplate
2014-07-16 16:17:25 -04:00
Justin Schottlaender 4fbb09ce52 Resolve various integer type mismatch Xcode warnings. 2014-07-11 14:22:03 -05:00
Justin Schottlaender ebe9998516 Mark progress properties as dynamic to prevent Xcode 5.1+ readwrite/readonly warnings. 2014-07-11 14:16:59 -05:00
Justin Schottlaender e0cf0b1fff Remove unused drawRect override from progress view base class. 2014-07-11 14:02:29 -05:00
62 changed files with 1693 additions and 1323 deletions
+63
View File
@@ -0,0 +1,63 @@
#####
# OS X temporary files that should never be committed
.DS_Store
*.swp
*.lock
profile
####
# Xcode temporary files that should never be committed
*~.nib
####
# Xcode build files
DerivedData/
build/
Builds/
#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
####
# Xcode 4 - semi-personal settings, often included in workspaces
xcuserdata
####
# XCode 4 workspaces - more detailed
!xcshareddata
!default.xcworkspace
*.xcworkspacedata
####
# XCode 4 build-schemes
!xcschemes
####
# Xcode 4 - Deprecated classes
*.moved-aside
####
# Xcode 5 - Source Control files
*.xccheckout
####
# AppCode
.idea/
####
# Other Xcode files
profile
*.hmap
*.ipa
####
# CocoaPods
Pods/
@@ -0,0 +1,24 @@
//
// UIApplication+M13ProgressSuite.m
// M13ProgressView
//
/*Copyright (c) 2013 Brandon McQuilkin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#import <UIKit/UIKit.h>
/**A UIApplication category that deals with app extensions.*/
@interface UIApplication (M13ProgressSuite)
/**Returns YES in case of app extension.*/
+ (BOOL)isM13AppExtension;
/**Returns the sharedApplication in case of app and nil in case of app extension.*/
+ (UIApplication *)safeM13SharedApplication;
@end
@@ -0,0 +1,29 @@
//
// UIApplication+M13ProgressSuite.m
// M13ProgressView
//
#import "UIApplication+M13ProgressSuite.h"
@implementation UIApplication (M13ProgressSuite)
+ (BOOL)isM13AppExtension
{
return [[self class] safeM13SharedApplication] == nil;
}
+ (UIApplication *)safeM13SharedApplication
{
UIApplication *safeSharedApplication = nil;
if ([UIApplication respondsToSelector:@selector(sharedApplication)]) {
safeSharedApplication = [UIApplication performSelector:@selector(sharedApplication)];
}
if (!safeSharedApplication.delegate) {
safeSharedApplication = nil;
}
return safeSharedApplication;
}
@end
+1 -1
View File
@@ -276,7 +276,7 @@
if (!_indeterminate) {
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
formatter.numberStyle = NSNumberFormatterPercentStyle;
return [NSString stringWithFormat:@"\n%@",[formatter stringFromNumber:[NSNumber numberWithFloat:_progress]]];
return [NSString stringWithFormat:@"\n%@",[formatter stringFromNumber:[NSNumber numberWithFloat:(float)_progress]]];
} else {
return @"\n??%";
}
+3
View File
@@ -83,6 +83,9 @@ typedef enum {
@property (nonatomic, assign) CGSize progressViewSize;
/**The origin of the show/hide animation. show: will animate from this point, and hide: will animate to this point.*/
@property (nonatomic, assign) CGPoint animationPoint;
/**If true, animation doesn't come from animation point, but frame background view position
*/
@property (nonatomic, assign) BOOL animationCentered;
/**@name Properties*/
/**The durations of animations in seconds.*/
+89 -57
View File
@@ -286,6 +286,7 @@
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated
{
[_progressView setProgress:progress animated:animated];
self.progress = progress;
}
- (void)performAction:(M13ProgressViewAction)action animated:(BOOL)animated
@@ -301,7 +302,7 @@
[self setNeedsDisplay];
onScreen = YES;
//Animate the HUD on screen
CABasicAnimation *fadeAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
fadeAnimation.duration = _animationDuration;
@@ -320,7 +321,16 @@
CABasicAnimation *positionAnimation = [CABasicAnimation animationWithKeyPath:@"position"];
positionAnimation.duration = _animationDuration;
positionAnimation.fromValue = [NSValue valueWithCGPoint:_animationPoint];
if (_animationCentered)
{
positionAnimation.fromValue = [NSValue valueWithCGPoint:backgroundView.layer.position];
}
else
{
positionAnimation.fromValue = [NSValue valueWithCGPoint:_animationPoint];
}
positionAnimation.toValue = [NSValue valueWithCGPoint:backgroundView.layer.position];
positionAnimation.removedOnCompletion = YES;
@@ -341,7 +351,7 @@
fadeAnimation.fromValue = [NSNumber numberWithFloat:1.0];
fadeAnimation.toValue = [NSNumber numberWithFloat:0.0];
fadeAnimation.removedOnCompletion = YES;
[self.layer addAnimation:fadeAnimation forKey:@"fadeAnimation"];
self.layer.opacity = 0.0;
@@ -349,11 +359,24 @@
scaleAnimation.fromValue = [NSNumber numberWithFloat:1.0];
scaleAnimation.toValue = [NSNumber numberWithFloat:0.0];
scaleAnimation.removedOnCompletion = YES;
CABasicAnimation *frameAnimation = [CABasicAnimation animationWithKeyPath:@"position"];
frameAnimation.fromValue = [NSValue valueWithCGPoint:backgroundView.layer.position];
frameAnimation.toValue = [NSValue valueWithCGPoint:_animationPoint];
if (_animationCentered)
{
frameAnimation.toValue = [NSValue valueWithCGPoint:backgroundView.layer.position];
}
else
{
frameAnimation.toValue = [NSValue valueWithCGPoint:_animationPoint];
}
frameAnimation.removedOnCompletion = YES;
if (!_animationCentered)
{
backgroundView.layer.position = _animationPoint;
}
backgroundView.layer.position = _animationPoint;
CAAnimationGroup *animationGroup = [CAAnimationGroup animation];
@@ -385,7 +408,7 @@
- (void)deviceOrientationDidChange:(NSNotification *)notification {
UIDeviceOrientation deviceOrientation = [notification.object orientation];
if (_shouldAutorotate && UIDeviceOrientationIsValidInterfaceOrientation(deviceOrientation)) {
if (UIDeviceOrientationIsPortrait(deviceOrientation)) {
if (deviceOrientation == UIDeviceOrientationPortraitUpsideDown) {
@@ -534,7 +557,7 @@
}
backgroundRect.origin.x = (self.bounds.size.width / 2.0) - (backgroundRect.size.width / 2.0);
backgroundRect.origin.y = (self.bounds.size.height / 2.0) - (_minimumSize.height / 2.0);
backgroundRect.origin.y = (self.bounds.size.height / 2.0) - (_minimumSize.height / 2.0);
//There is no status label text, center the progress view
progressRect.origin.x = (backgroundRect.size.width / 2.0) - (progressRect.size.width / 2.0);
@@ -554,19 +577,19 @@
if (onScreen) {
//Set the frame of the background and its subviews
[UIView animateWithDuration:_animationDuration animations:^{
backgroundView.frame = CGRectIntegral(backgroundRect);
_progressView.frame = CGRectIntegral(progressRect);
backgroundView.transform = CGAffineTransformMakeRotation([self angleForDeviceOrientation]);
self->backgroundView.frame = CGRectIntegral(backgroundRect);
self.progressView.frame = CGRectIntegral(progressRect);
self->backgroundView.transform = CGAffineTransformMakeRotation([self angleForDeviceOrientation]);
//Fade the label
statusLabel.alpha = 0.0;
self->statusLabel.alpha = 0.0;
} completion:^(BOOL finished) {
if (finished) {
//Set the label frame
statusLabel.frame = CGRectIntegral(statusRect);
statusLabel.text = optimalStatusString;
[UIView animateWithDuration:_animationDuration animations:^{
self->statusLabel.frame = CGRectIntegral(statusRect);
self->statusLabel.text = self->optimalStatusString;
[UIView animateWithDuration:self.animationDuration animations:^{
//Show the label
statusLabel.alpha = 1.0;
self->statusLabel.alpha = 1.0;
}];
}
}];
@@ -608,17 +631,17 @@
for (NSString *rect in sizesArray) {
CGRect theRect = CGRectFromString(rect);
//Sum the widths to calculate the mean width
standardDeviation += exp2f(theRect.size.width - meanWidth);
standardDeviation += exp2f((float)theRect.size.width - meanWidth);
}
standardDeviation = sqrtf(standardDeviation / wordsArray.count);
//Correct the mean width if it is below the minimum size
if (meanWidth < _minimumSize.width) {
meanWidth = _minimumSize.width;
if (meanWidth < self.minimumSize.width) {
meanWidth = (float)self.minimumSize.width;
}
//Now calculate where to put line breaks. Lines can exceed the minimum width, but cannot exceed the minimum width plus the standard deviation. Single words can excced these limits.
NSMutableString *correctedString = [[NSMutableString alloc] initWithString:wordsArray[0]];
float lineSize = CGRectFromString(sizesArray[0]).size.width;
float lineSize = (float)CGRectFromString(sizesArray[0]).size.width;
for (int i = 1; i < wordsArray.count; i++) {
NSString *word = wordsArray[i];
CGRect wordRect = CGRectFromString(sizesArray[i]);
@@ -674,6 +697,11 @@
//Create the gradient as an image, and then set it as the color of the mask view.
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, [UIScreen mainScreen].scale);
CGContextRef context = UIGraphicsGetCurrentContext();
if (!context) {
return;
}
//Create the gradient
size_t locationsCount = 2;
CGFloat locations[2] = {0.0f, 1.0f};
@@ -683,7 +711,7 @@
CGColorSpaceRelease(colorSpace);
//Draw the gradient
CGPoint center = CGPointMake(self.bounds.size.width / 2.0, self.bounds.size.height / 2.0);
float radius = MIN(self.bounds.size.width , self.bounds.size.height) ;
float radius = (float)MIN(self.bounds.size.width , self.bounds.size.height) ;
CGContextDrawRadialGradient (context, gradient, center, 0, center, radius, kCGGradientDrawsAfterEndLocation);
CGGradientRelease(gradient);
//Get the gradient image
@@ -691,6 +719,7 @@
UIGraphicsEndImageContext();
//Set the background
maskView.backgroundColor = [UIColor colorWithPatternImage:image];
} else if (_maskType == M13ProgressHUDMaskTypeIOS7Blur) {
// do nothing; we don't want to take a snapshot of the background for blurring now, no idea what the background is
}
@@ -698,45 +727,45 @@
- (void)redrawBlurs
{
if (_maskType == M13ProgressHUDMaskTypeIOS7Blur) {
//Get the snapshot of the mask
__block UIImage *image = [self snapshotForBlurredBackgroundInView:maskView];
if (image != nil) {
//Apply the filters to blur the image
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
image = [image applyLightEffect];
dispatch_async(dispatch_get_main_queue(), ^{
// Fade on content's change, if there was already an image.
CATransition *transition = [CATransition new];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[maskView.layer addAnimation:transition forKey:nil];
maskView.backgroundColor = [UIColor colorWithPatternImage:image];
});
if (_maskType == M13ProgressHUDMaskTypeIOS7Blur) {
//Get the snapshot of the mask
__block UIImage *image = [self snapshotForBlurredBackgroundInView:maskView];
if (image != nil) {
//Apply the filters to blur the image
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
image = [image applyLightEffect];
dispatch_async(dispatch_get_main_queue(), ^{
// Fade on content's change, if there was already an image.
CATransition *transition = [CATransition new];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[self->maskView.layer addAnimation:transition forKey:nil];
self->maskView.backgroundColor = [UIColor colorWithPatternImage:image];
});
}
});
}
if (_applyBlurToBackground) {
//Get the snapshot of the mask
__block UIImage *image = [self snapshotForBlurredBackgroundInView:backgroundView];
if (image != nil) {
//Apply the filters to blur the image
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//image = [image applyLightEffect];
image = [image applyLightEffect];
dispatch_async(dispatch_get_main_queue(), ^{
// Fade on content's change, if there was already an image.
CATransition *transition = [CATransition new];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[backgroundView.layer addAnimation:transition forKey:nil];
backgroundView.backgroundColor = [UIColor colorWithPatternImage:image];
});
}
if (_applyBlurToBackground) {
//Get the snapshot of the mask
__block UIImage *image = [self snapshotForBlurredBackgroundInView:backgroundView];
if (image != nil) {
//Apply the filters to blur the image
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//image = [image applyLightEffect];
image = [image applyLightEffect];
dispatch_async(dispatch_get_main_queue(), ^{
// Fade on content's change, if there was already an image.
CATransition *transition = [CATransition new];
transition.duration = 0.3;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[self->backgroundView.layer addAnimation:transition forKey:nil];
self->backgroundView.backgroundColor = [UIColor colorWithPatternImage:image];
});
}
});
}
}
}
- (UIImage *)snapshotForBlurredBackgroundInView:(UIView *)view
@@ -754,6 +783,9 @@
//Draw the snapshot view into a UIImage
UIGraphicsBeginImageContextWithOptions(snapshotView.bounds.size, YES, [UIScreen mainScreen].scale);
CGContextRef context = UIGraphicsGetCurrentContext();
if (!context) {
return nil;
}
CGContextTranslateCTM(context, viewRect.origin.x, viewRect.origin.y);
BOOL result = [self.superview drawViewHierarchyInRect:viewRect afterScreenUpdates:YES];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
@@ -789,7 +821,7 @@
{
for (id view in self.subviews) {
//If the subview is a progress HUD return it.
if ([[view class] isSubclassOfClass:[M13ProgressView class]]) {
if ([[view class] isSubclassOfClass:[M13ProgressHUD class]]) {
return view;
}
}
+3 -3
View File
@@ -127,7 +127,7 @@
{
const CGFloat EffectColorAlpha = 0.6;
UIColor *effectColor = tintColor;
int componentCount = CGColorGetNumberOfComponents(tintColor.CGColor);
NSInteger componentCount = CGColorGetNumberOfComponents(tintColor.CGColor);
if (componentCount == 2) {
CGFloat b;
if ([tintColor getWhite:&b alpha:NULL]) {
@@ -200,7 +200,7 @@
// ... if d is odd, use three box-blurs of size 'd', centered on the output pixel.
//
CGFloat inputRadius = blurRadius * [[UIScreen mainScreen] scale];
NSUInteger radius = floor(inputRadius * 3. * sqrt(2 * M_PI) / 4 + 0.5);
unsigned int radius = (int)floor(inputRadius * 3. * sqrt(2 * M_PI) / 4 + 0.5);
if (radius % 2 != 1) {
radius += 1; // force radius to be odd so that the three box-blur methodology works.
}
@@ -221,7 +221,7 @@
NSUInteger matrixSize = sizeof(floatingPointSaturationMatrix)/sizeof(floatingPointSaturationMatrix[0]);
int16_t saturationMatrix[matrixSize];
for (NSUInteger i = 0; i < matrixSize; ++i) {
saturationMatrix[i] = (int16_t)roundf(floatingPointSaturationMatrix[i] * divisor);
saturationMatrix[i] = (int16_t)roundf((float)floatingPointSaturationMatrix[i] * divisor);
}
if (hasBlur) {
vImageMatrixMultiply_ARGB8888(&effectOutBuffer, &effectInBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags);
@@ -27,9 +27,11 @@
/**Set the string to replace the UINavigationBar's title with while showing progress. Send nil to reset the title.
@param title The string to replace the UINavigationBar's title while showing progress.*/
- (void)setProgressTitle:(NSString *)title;
/**Set wether or not to show indeterminate.
/**Set whether or not to show indeterminate.
@param indeterminate wether or not the progress bar is indeterminate.*/
- (void)setIndeterminate:(BOOL)indeterminate;
/**Get whether or not to show indeterminate.*/
- (BOOL)getIndeterminate;
/**Fill the progress bar completely and remove it from display.*/
- (void)finishProgress;
/**Remove the progress bar from the display.*/
@@ -48,5 +50,11 @@
@param secondaryColor The color to set.
*/
- (void)setSecondaryColor:(UIColor *)secondaryColor;
/**
The background color of the progress bar, if nil, the background color will be the clearColor.
@param background The color to set.
*/
- (void)setBackgroundColor:(UIColor *)backgroundColor;
@end
@@ -4,6 +4,7 @@
//
#import "UINavigationController+M13ProgressViewBar.h"
#import "UIApplication+M13ProgressSuite.h"
#import <objc/runtime.h>
//Keys to set properties since one cannot define properties in a category.
@@ -19,6 +20,8 @@ static char indeterminateLayerKey;
static char isShowingProgressKey;
static char primaryColorKey;
static char secondaryColorKey;
static char backgroundColorKey;
static char backgroundViewKey;
@implementation UINavigationController (M13ProgressViewBar)
@@ -49,7 +52,7 @@ static char secondaryColorKey;
if (animated == NO) {
if (displayLink) {
//Kill running animations
[displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[displayLink invalidate];
[self setDisplayLink:nil];
}
[self setProgress:progress];
@@ -59,7 +62,7 @@ static char secondaryColorKey;
[self setAnimationToValue:progress];
if (!displayLink) {
//Create and setup the display link
[displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[displayLink invalidate];
displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self setDisplayLink:displayLink];
[displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
@@ -75,7 +78,7 @@ static char secondaryColorKey;
CGFloat dt = (displayLink.timestamp - [self getAnimationStartTime]) / [self getAnimationDuration];
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[displayLink invalidate];
[self setDisplayLink:nil];
[self setProgress:[self getAnimationToValue]];
return;
@@ -90,8 +93,8 @@ static char secondaryColorKey;
- (void)finishProgress
{
UIView *progressView = [self getProgressView];
if (progressView) {
UIView *backgroundView = [self getBackgroundView];
if (progressView && backgroundView) {
dispatch_async(dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.1 animations:^{
CGRect progressFrame = progressView.frame;
@@ -100,8 +103,11 @@ static char secondaryColorKey;
} completion:^(BOOL finished) {
[UIView animateWithDuration:0.5 animations:^{
progressView.alpha = 0;
backgroundView.alpha = 0;
} completion:^(BOOL finished) {
[progressView removeFromSuperview];
[backgroundView removeFromSuperview];
backgroundView.alpha = 1;
progressView.alpha = 1;
[self setTitle:nil];
[self setIsShowingProgressBar:NO];
@@ -114,14 +120,18 @@ static char secondaryColorKey;
- (void)cancelProgress
{
UIView *progressView = [self getProgressView];
if (progressView) {
UIView *backgroundView = [self getBackgroundView];
if (progressView && backgroundView) {
dispatch_async(dispatch_get_main_queue(), ^{
[UIView animateWithDuration:0.5 animations:^{
progressView.alpha = 0;
backgroundView.alpha = 0;
} completion:^(BOOL finished) {
[progressView removeFromSuperview];
[backgroundView removeFromSuperview];
progressView.alpha = 1;
backgroundView.alpha = 1;
[self setTitle:nil];
[self setIsShowingProgressBar:NO];
}];
@@ -129,14 +139,35 @@ static char secondaryColorKey;
}
}
#pragma mark Orientation
- (UIInterfaceOrientation)currentDeviceOrientation
{
UIInterfaceOrientation orientation;
if ([UIApplication isM13AppExtension]) {
if ([UIScreen mainScreen].bounds.size.width < [UIScreen mainScreen].bounds.size.height) {
orientation = UIInterfaceOrientationPortrait;
} else {
orientation = UIInterfaceOrientationLandscapeLeft;
}
} else {
orientation = [UIApplication safeM13SharedApplication].statusBarOrientation;
}
return orientation;
}
#pragma mark Drawing
- (void)showProgress
{
UIView *progressView = [self getProgressView];
UIView *backgroundView = [self getBackgroundView];
[UIView animateWithDuration:.1 animations:^{
progressView.alpha = 1;
backgroundView.alpha = 1;
}];
[self setIsShowingProgressBar:YES];
@@ -144,7 +175,7 @@ static char secondaryColorKey;
- (void)updateProgress
{
[self updateProgressWithInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation];
[self updateProgressWithInterfaceOrientation:[self currentDeviceOrientation]];
}
- (void)updateProgressWithInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
@@ -154,16 +185,39 @@ static char secondaryColorKey;
if(!progressView)
{
progressView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 2.5)];
progressView.backgroundColor = self.navigationBar.tintColor;
if ([self getPrimaryColor]) {
progressView.backgroundColor = [self getPrimaryColor];
}
progressView.clipsToBounds = YES;
[self setProgressView:progressView];
}
if ([self getPrimaryColor]) {
progressView.backgroundColor = [self getPrimaryColor];
} else {
progressView.backgroundColor = self.navigationBar.tintColor;
}
//Create background view if it doesn't exist
UIView *backgroundView = [self getBackgroundView];
if (!backgroundView)
{
backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 2.5)];
backgroundView.clipsToBounds = YES;
[self setBackgroundView:backgroundView];
}
if ([self getBackgroundColor]) {
backgroundView.backgroundColor = [self getBackgroundColor];
} else {
backgroundView.backgroundColor = [UIColor clearColor];
}
//Calculate the frame of the navigation bar, based off the orientation.
CGSize screenSize = [UIScreen mainScreen].bounds.size;
UIView *topView = self.topViewController.view;
CGSize screenSize;
if (topView) {
screenSize = topView.bounds.size;
} else {
screenSize = [UIScreen mainScreen].bounds.size;
}
CGFloat width = 0.0;
CGFloat height = 0.0;
//Calculate the width of the screen
@@ -183,20 +237,21 @@ static char secondaryColorKey;
//Check if the progress view is in its superview and if we are showing the bar.
if (progressView.superview == nil && [self isShowingProgressBar]) {
[self.navigationBar addSubview:backgroundView];
[self.navigationBar addSubview:progressView];
}
//Layout
if (![self getIndeterminate]) {
//Calculate the width of the progress view;
float progressWidth = width * [self getProgress];
float progressWidth = (float)width * (float)[self getProgress];
//Set the frame of the progress view
progressView.frame = CGRectMake(0, height - 2.5, progressWidth, 2.5);
} else {
//Calculate the width of the progress view
progressView.frame = CGRectMake(0, height - 2.5, width, 2.5);
}
backgroundView.frame = CGRectMake(0, height - 2.5, width, 2.5);
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
@@ -207,7 +262,7 @@ static char secondaryColorKey;
- (void)drawIndeterminate
{
[self drawIndeterminateWithInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation];
[self drawIndeterminateWithInterfaceOrientation:[self currentDeviceOrientation]];
}
- (void)drawIndeterminateWithInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
@@ -224,20 +279,13 @@ static char secondaryColorKey;
//Calculate the frame of the navigation bar, based off the orientation.
CGSize screenSize = [UIScreen mainScreen].bounds.size;
CGFloat width = 0.0;
CGFloat height = 0.0;
//Calculate the width of the screen
if (UIInterfaceOrientationIsLandscape(interfaceOrientation)) {
//Use the maximum value
width = MAX(screenSize.width, screenSize.height);
if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
height = 32.0; //Hate hardcoding values, but autolayout doesn't work, and cant retreive the new height until after the animation completes.
} else {
height = 44.0; //Hate hardcoding values, but autolayout doesn't work, and cant retreive the new height until after the animation completes.
}
} else {
//Use the minimum value
width = MIN(screenSize.width, screenSize.height);
height = 44.0; //Hate hardcoding values, but autolayout doesn't work, and cant retreive the new height until after the animation completes.
}
//Create the pattern image
@@ -342,7 +390,7 @@ static char secondaryColorKey;
- (void)setAnimationFromValue:(CGFloat)animationFromValue
{
objc_setAssociatedObject(self, &animationFromKey, [NSNumber numberWithFloat:animationFromValue], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
objc_setAssociatedObject(self, &animationFromKey, [NSNumber numberWithFloat:(float)animationFromValue], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (CGFloat)getAnimationFromValue
@@ -353,7 +401,7 @@ static char secondaryColorKey;
- (void)setAnimationToValue:(CGFloat)animationToValue
{
objc_setAssociatedObject(self, &animationToKey, [NSNumber numberWithFloat:animationToValue], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
objc_setAssociatedObject(self, &animationToKey, [NSNumber numberWithFloat:(float)animationToValue], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (CGFloat)getAnimationToValue
@@ -364,7 +412,7 @@ static char secondaryColorKey;
- (void)setAnimationStartTime:(NSTimeInterval)animationStartTime
{
objc_setAssociatedObject(self, &animationStartTimeKey, [NSNumber numberWithFloat:animationStartTime], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
objc_setAssociatedObject(self, &animationStartTimeKey, [NSNumber numberWithFloat:(float)animationStartTime], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (NSTimeInterval)getAnimationStartTime
@@ -380,7 +428,7 @@ static char secondaryColorKey;
} else if (progress < 0.0) {
progress = 0.0;
}
objc_setAssociatedObject(self, &progressKey, [NSNumber numberWithFloat:progress], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
objc_setAssociatedObject(self, &progressKey, [NSNumber numberWithFloat:(float)progress], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
//Draw the update
if ([NSThread isMainThread]) {
[self updateProgress];
@@ -418,6 +466,17 @@ static char secondaryColorKey;
return objc_getAssociatedObject(self, &progressViewKey);
}
- (void)setBackgroundView:(UIView *)view
{
objc_setAssociatedObject(self, &backgroundViewKey, view, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (UIView *)getBackgroundView
{
return objc_getAssociatedObject(self, &backgroundViewKey);
}
- (void)setIndeterminate:(BOOL)indeterminate
{
objc_setAssociatedObject(self, &indeterminateKey, [NSNumber numberWithBool:indeterminate], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
@@ -443,7 +502,7 @@ static char secondaryColorKey;
- (BOOL)isShowingProgressBar
{
return objc_getAssociatedObject(self, &isShowingProgressKey);
return [objc_getAssociatedObject(self, &isShowingProgressKey) boolValue];
}
- (void)setPrimaryColor:(UIColor *)primaryColor
@@ -469,4 +528,15 @@ static char secondaryColorKey;
return objc_getAssociatedObject(self, &secondaryColorKey);
}
- (void)setBackgroundColor:(UIColor *)backgroundColor
{
objc_setAssociatedObject(self, &backgroundColorKey, backgroundColor, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
[self setIndeterminate:[self getIndeterminate]];
}
- (UIColor *)getBackgroundColor
{
return objc_getAssociatedObject(self, &backgroundColorKey);
}
@end
-9
View File
@@ -34,13 +34,4 @@
//To be overriden in subclasses
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end
@@ -35,6 +35,8 @@ typedef enum {
@property (nonatomic, assign) M13ProgressViewBarProgressDirection progressDirection;
/**The thickness of the progress bar.*/
@property (nonatomic, assign) CGFloat progressBarThickness;
/**The corner radius of the progress bar.*/
@property (nonatomic, assign) CGFloat progressBarCornerRadius;
/**@name Actions*/
/**The color the bar changes to for the success action.*/
@property (nonatomic, retain) UIColor *successColor;
+47 -12
View File
@@ -76,6 +76,7 @@
self.animationDuration = .3;
_progressDirection = M13ProgressViewBarProgressDirectionLeftToRight;
_progressBarThickness = 2;
_progressBarCornerRadius = _progressBarThickness / 2.0;
_percentagePosition = M13ProgressViewBarPercentagePositionRight;
_showPercentage = YES;
@@ -92,7 +93,7 @@
//Progress View
_progressBar = [[UIView alloc] init];
_progressBar.backgroundColor = self.secondaryColor;
_progressBar.layer.cornerRadius = _progressBarThickness / 2.0;
_progressBar.layer.cornerRadius = _progressBarCornerRadius;
_progressBar.clipsToBounds = YES;
[self addSubview:_progressBar];
@@ -115,7 +116,7 @@
//IndeterminateLayer
_indeterminateLayer = [CALayer layer];
_indeterminateLayer.backgroundColor = self.primaryColor.CGColor;
_indeterminateLayer.cornerRadius = _progressBarThickness / 2.0;
_indeterminateLayer.cornerRadius = _progressBarCornerRadius;
_indeterminateLayer.opacity = 0;
[_progressBar.layer addSublayer:_indeterminateLayer];
@@ -182,8 +183,20 @@
[self setNeedsDisplay];
//Update strokeWidth
_progressLayer.lineWidth = progressBarThickness;
//Update the corner radius
[self invalidateIntrinsicContentSize];
}
- (void)setProgressBarCornerRadius:(CGFloat)progressBarCornerRadius
{
_progressBarCornerRadius = progressBarCornerRadius;
// Update the layer size
[self setNeedsDisplay];
// Update corner radius for layers
_progressBar.layer.cornerRadius = _progressBarCornerRadius;
_indeterminateLayer.cornerRadius = _progressBarCornerRadius;
[self invalidateIntrinsicContentSize];
}
#pragma mark Actions
@@ -193,7 +206,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -204,7 +217,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -216,18 +229,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -237,7 +250,7 @@
{
if (action == M13ProgressViewActionNone && _currentAction != M13ProgressViewActionNone) {
_currentAction = action;
_percentageLabel.string = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:self.progress]];
_percentageLabel.string = [self.percentageFormatter stringFromNumber:[NSNumber numberWithFloat:(float)self.progress]];
[self setNeedsDisplay];
[CATransaction begin];
CABasicAnimation *barAnimation = [self barColorAnimation];
@@ -360,7 +373,7 @@
//Remove all animations
[_indeterminateLayer removeAnimationForKey:@"position"];
//Reset progress text
_percentageLabel.string = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:self.progress]];
_percentageLabel.string = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:(float)self.progress]];
}
}
@@ -534,6 +547,26 @@
}
- (CGSize)intrinsicContentSize
{
CGFloat labelProgressBufferDistance = _progressBarThickness * 4;
//Progress bar thickness is the only non-scale based size parameter.
if (_progressDirection == M13ProgressViewBarProgressDirectionBottomToTop || _progressDirection == M13ProgressViewBarProgressDirectionTopToBottom) {
if (_percentagePosition == M13ProgressViewBarPercentagePositionTop || _percentagePosition == M13ProgressViewBarPercentagePositionBottom) {
return CGSizeMake(_progressBarThickness, labelProgressBufferDistance);
} else {
return CGSizeMake(_progressBarThickness + labelProgressBufferDistance, UIViewNoIntrinsicMetric);
}
} else {
if (_percentagePosition == M13ProgressViewBarPercentagePositionTop || _percentagePosition == M13ProgressViewBarPercentagePositionBottom) {
return CGSizeMake(UIViewNoIntrinsicMetric, _progressBarThickness + labelProgressBufferDistance);
} else {
return CGSizeMake(labelProgressBufferDistance, _progressBarThickness);
}
}
}
- (CGFloat)maximumFontSizeThatFitsInRect:(CGRect)frame
{
//Starting parameters
@@ -567,7 +600,7 @@
_percentageLabel.string = @"";
} else if (_currentAction == M13ProgressViewActionNone) {
if (!self.indeterminate) {
_percentageLabel.string = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:self.progress]];
_percentageLabel.string = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:(float)self.progress]];
} else {
_percentageLabel.string = @"";
}
@@ -596,6 +629,8 @@
[path addLineToPoint:CGPointMake(_progressBarThickness / 2.0, _progressLayer.frame.size.height * self.progress)];
[_progressLayer setPath:path.CGPath];
}
} else {
[_progressLayer setPath:nil];
}
}
@@ -179,7 +179,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -190,7 +190,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -202,18 +202,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -347,6 +347,11 @@
}
}
- (CGSize)intrinsicContentSize
{
return CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
}
#pragma mark Drawing
- (void)drawRect:(CGRect)rect
@@ -102,7 +102,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -113,7 +113,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -125,18 +125,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -161,6 +161,11 @@
_progressView.frame = self.bounds;
}
- (CGSize)intrinsicContentSize
{
return CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
}
#pragma mark Drawing
- (void)drawRect:(CGRect)rect
@@ -181,7 +186,7 @@
//Calculate the current value
CGFloat value = startValue + ((endValue - startValue) * self.progress);
//Set the value
[filter setValue:[NSNumber numberWithFloat:value] forKey:parameterKey];
[filter setValue:[NSNumber numberWithFloat:(float)value] forKey:parameterKey];
}
//Set the input image
[filter setValue:image forKey:kCIInputImageKey];
+23 -16
View File
@@ -32,6 +32,8 @@
@implementation M13ProgressViewImage
@dynamic progress;
#pragma mark Initalization and setup
- (id)init
@@ -109,7 +111,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -120,7 +122,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -132,18 +134,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -168,6 +170,11 @@
_progressView.frame = self.bounds;
}
- (CGSize)intrinsicContentSize
{
return CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
}
#pragma mark Drawing
- (void)drawRect:(CGRect)rect
@@ -180,15 +187,15 @@
- (UIImage *)createImageForCurrentProgress
{
const int ALPHA = 0;
const int RED = 1;
const int RED = 3;
const int GREEN = 2;
const int BLUE = 3;
const int BLUE = 1;
//Create image rectangle with current image width/height
CGRect imageRect = CGRectMake(0, 0, _progressImage.size.width * _progressImage.scale, _progressImage.size.height * _progressImage.scale);
int width = imageRect.size.width;
int height = imageRect.size.height;
int width = (int)imageRect.size.width;
int height = (int)imageRect.size.height;
//The pixels will be painted to this array
uint32_t *pixels = (uint32_t *) malloc(width * height * sizeof(uint32_t));
@@ -211,13 +218,13 @@
int yTo = height;
if (_progressDirection == M13ProgressViewImageProgressDirectionBottomToTop) {
yTo = height * (1 - self.progress);
yTo = (int)(height * (1 - self.progress));
} else if (_progressDirection == M13ProgressViewImageProgressDirectionTopToBottom) {
yFrom = height * self.progress;
yFrom = (int)(height * self.progress);
} else if (_progressDirection == M13ProgressViewImageProgressDirectionLeftToRight) {
xFrom = width * self.progress;
xFrom = (int)(width * self.progress);
} else if (_progressDirection == M13ProgressViewImageProgressDirectionRightToLeft) {
xTo = width * (1 - self.progress);
xTo = (int)(width * (1 - self.progress));
}
for (int x = xFrom; x < xTo; x++) {
@@ -227,7 +234,7 @@
//Convert
if (_drawGreyscaleBackground) {
//Convert to grayscale using luma coding: http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
uint32_t gray = 0.3 * rgbaPixel[RED] + 0.59 * rgbaPixel[GREEN] + 0.11 * rgbaPixel[BLUE];
uint8_t gray = (uint8_t)(0.3 * rgbaPixel[RED] + 0.59 * rgbaPixel[GREEN] + 0.11 * rgbaPixel[BLUE]);
// set the pixels to gray
rgbaPixel[RED] = gray;
rgbaPixel[GREEN] = gray;
@@ -24,7 +24,7 @@ typedef enum {
*/
@property (nonatomic, assign) M13ProgressViewLetterpressPointShape pointShape;
/**
The amount of space between the grid points.
The amount of space between the grid points, as a percentage of the point's size.
*/
@property (nonatomic, assign) CGFloat pointSpacing;
/**
@@ -108,7 +108,6 @@
_springDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(rotateWithDisplayLink:)];
[_springDisplayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:(id)kCFRunLoopCommonModes];
}
- (void)setFrame:(CGRect)frame
@@ -127,6 +126,12 @@
[letterpressView setNeedsDisplay];
}
- (CGSize)intrinsicContentSize
{
//Everything is based on scale. No minimum size.
return CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
}
#pragma mark - Properties
- (void)setNumberOfGridPoints:(CGPoint)numberOfGridPoints
@@ -143,6 +148,11 @@
- (void)setPointSpacing:(CGFloat)pointSpacing
{
if (pointSpacing > 1) {
pointSpacing = 1;
} else if (pointSpacing < 0) {
pointSpacing = 0;
}
_pointSpacing = pointSpacing;
[self setNeedsDisplay];
}
@@ -160,7 +170,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -171,7 +181,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -183,18 +193,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -221,7 +231,7 @@
[view setTransform:CGAffineTransformMakeRotation(rotation * M_PI / 180)];
//If we are slowing down, animate to a new angle.
if (fabsf(velocity) < 1) {
if (fabs(velocity) < 1) {
restRotation += (arc4random() & 2 ? 90 : -90);
}
}
@@ -246,10 +256,10 @@
//Setup
CGRect pointRect = CGRectZero;
int index = -1;
int indexToFillTo = _progressView.numberOfGridPoints.x * _progressView.numberOfGridPoints.y * _progressView.progress;
int indexToFillTo = (int)(_progressView.numberOfGridPoints.x * _progressView.numberOfGridPoints.y * _progressView.progress);
//Draw
for (int y = _progressView.numberOfGridPoints.y - 1; y >= 0; y--) {
for (int y = (int)_progressView.numberOfGridPoints.y - 1; y >= 0; y--) {
for (int x = 0; x < _progressView.numberOfGridPoints.x; x++) {
index += 1;
@@ -263,7 +273,7 @@
//Calculat the rect of the point
pointRect.size = pointSize;
pointRect.origin = CGPointMake(pointSize.width * x, pointSize.height * y);
pointRect = CGRectInset(pointRect, _progressView.pointSpacing, _progressView.pointSpacing);
pointRect = CGRectInset(pointRect, pointSize.width * _progressView.pointSpacing, pointSize.height * _progressView.pointSpacing);
//Set the fill color
if (index < indexToFillTo) {
@@ -285,4 +295,6 @@
}
}
@end
+1 -3
View File
@@ -15,7 +15,7 @@ typedef enum {
} M13ProgressViewMetroAnimationShape;
/**The layer that the `M13ProgressViewMetro` animates.*/
@interface M13ProgressViewMetroDot : CALayer <NSCopying>
@interface M13ProgressViewMetroDot : CALayer
/**Wether or not the dot is highlighted. The dot becomes highlighted to show progress.*/
@property (nonatomic, assign) BOOL highlighted;
@@ -31,8 +31,6 @@ typedef enum {
@param action The action to perform.
@param animated Wether or not to animate the change*/
- (void)performAction:(M13ProgressViewAction)action animated:(BOOL)animated;
/**All subclasses must respond to NSCopying.*/
- (id)copy;
@end
+26 -8
View File
@@ -213,6 +213,15 @@
- (void)setNumberOfDots:(NSUInteger)numberOfDots
{
_numberOfDots = numberOfDots;
[self invalidateIntrinsicContentSize];
[self stopAnimating];
[self beginAnimating];
}
- (void)setDotSize:(CGSize)dotSize
{
_dotSize = dotSize;
[self invalidateIntrinsicContentSize];
[self stopAnimating];
[self beginAnimating];
}
@@ -229,7 +238,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -240,7 +249,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -252,18 +261,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self showProgress];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self showProgress];
});
@@ -272,7 +281,7 @@
- (void)showProgress
{
static int pastIndexToHighlightTo = 0;
int indexToHighlightTo = ceilf(_numberOfDots * self.progress);
int indexToHighlightTo = (int)ceilf(_numberOfDots * (float)self.progress);
//Only perform the animation if necessary.
if (pastIndexToHighlightTo != indexToHighlightTo) {
for (int i = 0; i < _numberOfDots; i++) {
@@ -285,7 +294,16 @@
}
pastIndexToHighlightTo = indexToHighlightTo;
}
}
- (CGSize)intrinsicContentSize
{
//No real constraint on size.
if (_animationShape == M13ProgressViewMetroAnimationShapeEllipse || _animationShape == M13ProgressViewMetroAnimationShapeRectangle) {
return CGSizeMake(3 * _dotSize.width, 3 * _dotSize.height);
} else {
return CGSizeMake(_dotSize.width * _numberOfDots, _dotSize.height);
}
}
#pragma mark Animation
@@ -33,7 +33,7 @@
} else {
NSMutableArray *pointsArray = [NSMutableArray array];
for (int i = 0; i < _numberOfSides; i++) {
CGPoint point = CGPointMake(_radius * cosf((2.0 * M_PI * (float)i) / (float)_numberOfSides), _radius * sinf((2.0 * M_PI * (float)i) / (float)_numberOfSides));
CGPoint point = CGPointMake(_radius * cosf((2.0f * (float)M_PI * (float)i) / (float)_numberOfSides), (float)_radius * sinf((2.0f * (float)M_PI * (float)i) / (float)_numberOfSides));
NSValue *value = [NSValue valueWithCGPoint:point];
[pointsArray addObject:value];
}
+33 -20
View File
@@ -47,6 +47,8 @@
BOOL _backgroundRingWidthOverriden;
}
@dynamic progress;
#pragma mark Initalization and setup
- (id)init
@@ -83,7 +85,7 @@
//Set defaut sizes
_backgroundRingWidthOverriden = NO;
_backgroundRingWidth = fmaxf(self.bounds.size.width * .025, 1.0);
_backgroundRingWidth = fmaxf((float)self.bounds.size.width * .025f, 1.0);
self.animationDuration = .3;
@@ -143,6 +145,7 @@
_backgroundLayer.lineWidth = _backgroundRingWidth;
_backgroundRingWidthOverriden = YES;
[self setNeedsDisplay];
[self invalidateIntrinsicContentSize];
}
#pragma mark Actions
@@ -155,7 +158,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:animated];
@@ -166,7 +169,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -178,18 +181,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -227,9 +230,9 @@
[CATransaction begin];
[_iconLayer addAnimation:[self hideAnimation] forKey:kM13ProgressViewPieHideKey];
[CATransaction setCompletionBlock:^{
_currentAction = action;
self.currentAction = action;
[self drawIcon];
[_iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewPieShowKey];
[self.iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewPieShowKey];
}];
[CATransaction commit];
}
@@ -251,9 +254,9 @@
[CATransaction begin];
[_iconLayer addAnimation:[self hideAnimation] forKey:kM13ProgressViewPieHideKey];
[CATransaction setCompletionBlock:^{
_currentAction = action;
self.currentAction = action;
[self drawIcon];
[_iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewPieShowKey];
[self.iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewPieShowKey];
}];
[CATransaction commit];
}
@@ -269,7 +272,7 @@
//Create the rotation animation
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0];
rotationAnimation.toValue = [NSNumber numberWithFloat: (float)(M_PI * 2.0)];
rotationAnimation.duration = 1;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = HUGE_VALF;
@@ -287,7 +290,7 @@
[_indeterminateLayer addAnimation:[self hideAnimation] forKey:kM13ProgressViewPieHideKey];
[CATransaction setCompletionBlock:^{
//Remove the rotation animation and reset the background
[_backgroundLayer removeAnimationForKey:@"rotationAnimation"];
[self.backgroundLayer removeAnimationForKey:@"rotationAnimation"];
[self drawBackground];
}];
[CATransaction commit];
@@ -334,13 +337,23 @@
//Update line widths if not overriden
if (!_backgroundRingWidthOverriden) {
_backgroundRingWidth = fmaxf(self.frame.size.width * .025, 1.0);
_backgroundRingWidth = fmaxf((float)self.frame.size.width * .025f, 1.0);
}
//Redraw
[self setNeedsDisplay];
}
- (CGSize)intrinsicContentSize
{
if (!_backgroundRingWidthOverriden) {
//Based on scale
return CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
} else {
return CGSizeMake(2 * _backgroundRingWidth, 2 * _backgroundRingWidth);
}
}
- (void)setFrame:(CGRect)frame
{
//Keep the progress view square.
@@ -430,8 +443,8 @@
- (void)drawBackground
{
//Create parameters to draw background
float startAngle = - M_PI_2;
float endAngle = startAngle + (2.0 * M_PI);
float startAngle = - (float)M_PI_2;
float endAngle = (float)(startAngle + (2.0 * M_PI));
CGPoint center = CGPointMake(self.bounds.size.width / 2.0, self.bounds.size.width / 2.0);
CGFloat radius = (self.bounds.size.width - _backgroundRingWidth) / 2.0;
@@ -448,8 +461,8 @@
- (void)drawProgress
{
//Create parameters to draw progress
float startAngle = - M_PI_2;
float endAngle = startAngle + (2.0 * M_PI * self.progress);
float startAngle = - (float)M_PI_2;
float endAngle = (float)(startAngle + (2.0 * M_PI * self.progress));
CGPoint center = CGPointMake(self.bounds.size.width / 2.0, self.bounds.size.width / 2.0);
CGFloat radius = (self.bounds.size.width - _backgroundRingWidth) / 2.0;
@@ -479,8 +492,8 @@
- (void)drawIndeterminate
{
//Create parameters to draw progress
float startAngle = - M_PI_2;
float endAngle = startAngle + (2.0 * M_PI * .2);
float startAngle = - (float)M_PI_2;
float endAngle = (float)(startAngle + (2.0 * M_PI * .2));
CGPoint center = CGPointMake(self.bounds.size.width / 2.0, self.bounds.size.width / 2.0);
CGFloat radius = (self.bounds.size.width - _backgroundRingWidth) / 2.0;
@@ -145,7 +145,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -156,7 +156,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -168,18 +168,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -221,6 +221,12 @@
}
}
- (CGSize)intrinsicContentSize
{
//The width and height should be set with constraints. Can't think of a good way to figure out the minimum size with the point and scale based size calculations.
return CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
}
#pragma mark Drawing
- (void)drawRect:(CGRect)rect
@@ -238,7 +244,7 @@
UIBezierPath *path;
int i = 0;
int indexOfLastFilledPath = ceilf(self.progress * (float)_numberOfRipples);
int indexOfLastFilledPath = (int)ceilf((float)self.progress * (float)_numberOfRipples);
while ((path = [enumerator nextObject])) {
//Set the path's color
if (!self.indeterminate) {
+31 -22
View File
@@ -82,7 +82,7 @@
self.backgroundColor = [UIColor clearColor];
//Set defaut sizes
_backgroundRingWidth = fmaxf(self.bounds.size.width * .025, 1.0);
_backgroundRingWidth = fmaxf((float)self.bounds.size.width * .025f, 1.0);
_progressRingWidth = 3 * _backgroundRingWidth;
_progressRingWidthOverriden = NO;
_backgroundRingWidthOverriden = NO;
@@ -147,7 +147,7 @@
{
_backgroundRingWidth = backgroundRingWidth;
_backgroundLayer.lineWidth = _backgroundRingWidth;
_progressRingWidthOverriden = YES;
_backgroundRingWidthOverriden = YES;
[self setNeedsDisplay];
}
@@ -186,7 +186,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:animated];
@@ -197,7 +197,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -209,18 +209,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -250,9 +250,9 @@
[CATransaction begin];
[_iconLayer addAnimation:[self hideAnimation] forKey:kM13ProgressViewRingHideKey];
[CATransaction setCompletionBlock:^{
_currentAction = action;
self.currentAction = action;
[self drawIcon];
[_iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewRingShowKey];
[self.iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewRingShowKey];
}];
[CATransaction commit];
}
@@ -270,9 +270,9 @@
[CATransaction begin];
[_iconLayer addAnimation:[self hideAnimation] forKey:kM13ProgressViewRingHideKey];
[CATransaction setCompletionBlock:^{
_currentAction = action;
self.currentAction = action;
[self drawIcon];
[_iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewRingShowKey];
[self.iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewRingShowKey];
}];
[CATransaction commit];
}
@@ -288,7 +288,7 @@
//Create the rotation animation
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0];
rotationAnimation.toValue = [NSNumber numberWithFloat: (float)(M_PI * 2.0)];
rotationAnimation.duration = 1;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = HUGE_VALF;
@@ -306,7 +306,7 @@
[_percentageLabel.layer addAnimation:[self showAnimation] forKey:kM13ProgressViewRingShowKey];
[CATransaction setCompletionBlock:^{
//Remove the rotation animation and reset the background
[_backgroundLayer removeAnimationForKey:@"rotationAnimation"];
[self.backgroundLayer removeAnimationForKey:@"rotationAnimation"];
[self drawBackground];
}];
[CATransaction commit];
@@ -357,12 +357,15 @@
//Update line widths if not overriden
if (!_backgroundRingWidthOverriden) {
_backgroundRingWidth = fmaxf(self.frame.size.width * .025, 1.0);
_backgroundRingWidth = fmaxf((float)self.frame.size.width * .025f, 1.0);
}
_backgroundLayer.lineWidth = _backgroundRingWidth;
if (!_progressRingWidthOverriden) {
_progressRingWidth = _backgroundRingWidth * 3;
}
_progressLayer.lineWidth = _progressRingWidth;
//Redraw
[self setNeedsDisplay];
}
@@ -376,6 +379,12 @@
[super setFrame:frame];
}
- (CGSize)intrinsicContentSize
{
//This progress view scales
return CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
}
#pragma mark Drawing
- (void)drawRect:(CGRect)rect
@@ -456,14 +465,14 @@
- (void)drawBackground
{
//Create parameters to draw background
float startAngle = - M_PI_2;
float endAngle = startAngle + (2.0 * M_PI);
float startAngle = - (float)M_PI_2;
float endAngle = (float)(startAngle + (2.0 * M_PI));
CGPoint center = CGPointMake(self.bounds.size.width / 2.0, self.bounds.size.width / 2.0);
CGFloat radius = (self.bounds.size.width - _backgroundRingWidth) / 2.0;
//If indeterminate, recalculate the end angle
if (self.indeterminate) {
endAngle = .8 * endAngle;
endAngle = .8f * endAngle;
}
//Draw path
@@ -479,8 +488,8 @@
- (void)drawProgress
{
//Create parameters to draw progress
float startAngle = - M_PI_2;
float endAngle = startAngle + (2.0 * M_PI * self.progress);
float startAngle = - (float)M_PI_2;
float endAngle = (float)(startAngle + (2.0 * M_PI * self.progress));
CGPoint center = CGPointMake(self.bounds.size.width / 2.0, self.bounds.size.width / 2.0);
CGFloat radius = (self.bounds.size.width - _progressRingWidth) / 2.0;
@@ -494,7 +503,7 @@
[_progressLayer setPath:path.CGPath];
//Update label
_percentageLabel.text = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:self.progress]];
_percentageLabel.text = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:(float)self.progress]];
}
- (void)drawIcon
@@ -45,5 +45,12 @@ typedef enum {
@property (nonatomic, retain) UIColor *successColor;
/**The color the bar changes to for the failure action.*/
@property (nonatomic, retain) UIColor *failureColor;
/**The array of UIColors that the segments will be colored with.
@note Each index in the array coresponds to a single segment. If there are more indicies then segments, not all colors will be used. If there are less indicies than segments, the colors will be looped. If nil, then a solid fill will be used.*/
@property (nonatomic, retain) NSArray *primaryColors;
/**The array of UIColors that the segment's backgrounds will be colored with.
@note Each index in the array coresponds to a single segment. If there are more indicies then segments, not all colors will be used. If there are less indicies than segments, the colors will be looped. If nil, then a solid fill will be used.*/
@property (nonatomic, retain) NSArray *secondaryColors;
@end
@@ -26,9 +26,7 @@
/**Allow us to write to the progress.*/
@property (nonatomic, readwrite) CGFloat progress;
/**The layer that progress is shown on.*/
@property (nonatomic, retain) CAShapeLayer *progressLayer;
/**The layer that the background shown on.*/
@property (nonatomic, retain) CAShapeLayer *backgroundLayer;
@property (nonatomic, retain) CAShapeLayer *segmentsLayer;
/**The action currently being performed.*/
@property (nonatomic, assign) M13ProgressViewAction currentAction;
@@ -36,10 +34,14 @@
@implementation M13ProgressViewSegmentedBar
{
int indeterminateIndex;
NSInteger indeterminateIndex;
NSTimer *indeterminateTimer;
NSArray *segmentColorsPrimary;
NSArray *segmentColorsBackground;
}
@dynamic progress;
#pragma mark Initalization and setup
- (id)init
@@ -74,13 +76,6 @@
//Set own background color
self.backgroundColor = [UIColor clearColor];
//Set defauts
self.animationDuration = .3;
_progressDirection = M13ProgressViewSegmentedBarProgressDirectionLeftToRight;
_numberOfSegments = 16;
_segmentSeparation = 10.0;
_cornerRadius = 2.0;
//Set default colors
self.primaryColor = [UIColor colorWithRed:0 green:122/255.0 blue:1.0 alpha:1.0];
self.secondaryColor = [UIColor colorWithRed:181/255.0 green:182/255.0 blue:183/255.0 alpha:1.0];
@@ -88,16 +83,16 @@
_failureColor = [UIColor colorWithRed:249.0f/255.0f green:37.0f/255.0f blue:0 alpha:1];
//ProgressLayer
_progressLayer = [CAShapeLayer layer];
_progressLayer.fillColor = self.primaryColor.CGColor;
_progressLayer.frame = self.bounds;
[self.layer addSublayer:_progressLayer];
_segmentsLayer = [CAShapeLayer layer];
_segmentsLayer.frame = self.bounds;
[self.layer addSublayer:_segmentsLayer];
//Backround
_backgroundLayer = [CAShapeLayer layer];
_backgroundLayer.fillColor = self.secondaryColor.CGColor;
_backgroundLayer.frame = self.bounds;
[self.layer addSublayer:_backgroundLayer];
//Set defauts
self.animationDuration = .3;
_progressDirection = M13ProgressViewSegmentedBarProgressDirectionLeftToRight;
self.numberOfSegments = 16;
_segmentSeparation = 10.0;
_cornerRadius = 2.0;
//Layout
[self layoutSubviews];
@@ -108,14 +103,14 @@
- (void)setPrimaryColor:(UIColor *)primaryColor
{
[super setPrimaryColor:primaryColor];
_progressLayer.fillColor = self.primaryColor.CGColor;
[self resetColorsForSegments];
[self setNeedsDisplay];
}
- (void)setSecondaryColor:(UIColor *)secondaryColor
{
[super setSecondaryColor:secondaryColor];
_backgroundLayer.fillColor = self.secondaryColor.CGColor;
[self resetColorsForSegments];
[self setNeedsDisplay];
}
@@ -141,6 +136,17 @@
- (void)setNumberOfSegments:(NSInteger)numberOfSegments
{
_numberOfSegments = numberOfSegments;
//First remove all the sub layers
_segmentsLayer.sublayers = nil;
//Then add sub layers equal to the number of segments
for (int i = 0; i < numberOfSegments; i++) {
CAShapeLayer *segment = [CAShapeLayer layer];
segment.frame = self.bounds;
[_segmentsLayer addSublayer:segment];
}
//Reset the colors for the segements
[self resetColorsForSegments];
[self setNeedsDisplay];
}
@@ -156,6 +162,18 @@
[self setNeedsDisplay];
}
- (void)setPrimaryColors:(NSArray *)primaryColors
{
_primaryColors = primaryColors;
[self resetColorsForSegments];
}
- (void)setSecondaryColors:(NSArray *)secondaryColors
{
_secondaryColors = secondaryColors;
[self resetColorsForSegments];
}
#pragma mark Actions
- (void)setProgress:(CGFloat)progress animated:(BOOL)animated
@@ -163,7 +181,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -174,7 +192,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -186,18 +204,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -209,28 +227,37 @@
_currentAction = action;
[self setNeedsDisplay];
[CATransaction begin];
CABasicAnimation *barAnimation = [self barColorAnimation];
barAnimation.fromValue = (id)_progressLayer.fillColor;
barAnimation.toValue = (id)self.primaryColor.CGColor;
[_progressLayer addAnimation:barAnimation forKey:@"fillColor"];
for (int i = 0; i < _numberOfSegments; i++) {
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
CABasicAnimation *barAnimation = [self barColorAnimation];
barAnimation.fromValue = (id)layer.fillColor;
barAnimation.toValue = (id)[self colorForSegment:i].CGColor;
[layer addAnimation:barAnimation forKey:@"fillColor"];
}
[CATransaction commit];
} else if (action == M13ProgressViewActionSuccess && _currentAction != M13ProgressViewActionSuccess) {
_currentAction = action;
[self setNeedsDisplay];
[CATransaction begin];
CABasicAnimation *barAnimation = [self barColorAnimation];
barAnimation.fromValue = (id)_progressLayer.fillColor;
barAnimation.toValue = (id)_successColor.CGColor;
[_progressLayer addAnimation:barAnimation forKey:@"fillColor"];
for (int i = 0; i < _numberOfSegments; i++) {
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
CABasicAnimation *barAnimation = [self barColorAnimation];
barAnimation.fromValue = (id)layer.fillColor;
barAnimation.toValue = (id)_successColor.CGColor;
[layer addAnimation:barAnimation forKey:@"fillColor"];
}
[CATransaction commit];
} else if (action == M13ProgressViewActionFailure && _currentAction != M13ProgressViewActionFailure) {
_currentAction = action;
[self setNeedsDisplay];
[CATransaction begin];
CABasicAnimation *barAnimation = [self barColorAnimation];
barAnimation.fromValue = (id)_progressLayer.fillColor;
barAnimation.toValue = (id)_failureColor.CGColor;
[_progressLayer addAnimation:barAnimation forKey:@"fillColor"];
for (int i = 0; i < _numberOfSegments; i++) {
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
CABasicAnimation *barAnimation = [self barColorAnimation];
barAnimation.fromValue = (id)layer.fillColor;
barAnimation.toValue = (id)_failureColor.CGColor;
[layer addAnimation:barAnimation forKey:@"fillColor"];
}
[CATransaction commit];
}
}
@@ -265,16 +292,83 @@
{
[super layoutSubviews];
_progressLayer.frame = self.bounds;
_backgroundLayer.frame = self.bounds;
_segmentsLayer.frame = self.bounds;
for (CAShapeLayer *layer in _segmentsLayer.sublayers) {
layer.frame = self.bounds;
}
}
- (CGSize)intrinsicContentSize
{
return CGSizeMake(UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric);
}
#pragma mark Drawing
- (void)resetColorsForSegments
{
if (_primaryColors == nil) {
NSMutableArray *tempArray = [NSMutableArray arrayWithCapacity:_numberOfSegments];
for (int i = 0; i < _numberOfSegments; i++) {
[tempArray addObject:self.primaryColor];
}
segmentColorsPrimary = tempArray.copy;
}
if (_numberOfSegments == _primaryColors.count) {
segmentColorsPrimary = _primaryColors;
}
if (_numberOfSegments != _primaryColors.count && _primaryColors.count != 0) {
NSMutableArray *tempArray = [NSMutableArray arrayWithCapacity:_numberOfSegments];
for (int i = 0; i < _numberOfSegments; i++) {
if (_numberOfSegments > _primaryColors.count) {
[tempArray addObject:_primaryColors[i]];
} else {
[tempArray addObject:_primaryColors[i % _primaryColors.count]];
}
}
segmentColorsPrimary = tempArray.copy;
}
if (_secondaryColors == nil) {
NSMutableArray *tempArray = [NSMutableArray arrayWithCapacity:_numberOfSegments];
for (int i = 0; i < _numberOfSegments; i++) {
[tempArray addObject:self.secondaryColor];
}
segmentColorsBackground = tempArray.copy;
}
if (_numberOfSegments == _secondaryColors.count) {
segmentColorsBackground = _secondaryColors;
}
if (_numberOfSegments != _secondaryColors.count && _secondaryColors.count != 0) {
NSMutableArray *tempArray = [NSMutableArray arrayWithCapacity:_numberOfSegments];
for (int i = 0; i < _numberOfSegments; i++) {
if (_numberOfSegments > _secondaryColors.count) {
[tempArray addObject:_secondaryColors[i]];
} else {
[tempArray addObject:_secondaryColors[i % _secondaryColors.count]];
}
}
segmentColorsBackground = tempArray.copy;
}
}
- (NSInteger)numberOfFullSegments
{
return (NSInteger)floorf(self.progress * _numberOfSegments);
return (NSInteger)floorf((float)self.progress * (float)_numberOfSegments);
}
- (UIColor *)colorForSegment:(NSUInteger)index
{
if (index < [self numberOfFullSegments]) {
return segmentColorsPrimary[index];
} else {
return segmentColorsBackground[index];
}
}
- (void)drawRect:(CGRect)rect
@@ -282,7 +376,6 @@
[super drawRect:rect];
if (!self.indeterminate) {
[self drawProgress];
[self drawBackground];
}
}
@@ -300,175 +393,8 @@
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
cornerRadius = _cornerRadius;
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
cornerRadius = floorf(self.bounds.size.height < segmentWidth ? self.bounds.size.height / 2.0 : segmentWidth / 2.0);
cornerRadius = floorf(self.bounds.size.height < segmentWidth ? (float)self.bounds.size.height / 2.0f : (float)segmentWidth / 2.0f);
}
//Create the path ref that all the paths will be appended
CGMutablePathRef pathRef = CGPathCreateMutable();
//Iterate through all the segments that are full.
for (int i = 0; i < [self numberOfFullSegments]; i++) {
UIBezierPath *path = [UIBezierPath bezierPath];
//Move to top left of rectangle
if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionLeftToRight) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), (self.bounds.size.height - (2 * cornerRadius)) / 2, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionRightToLeft) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, (self.bounds.size.height - (2 * cornerRadius)) / 2, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionBottomToTop) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(0, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(0, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake((self.bounds.size.width - (2 * cornerRadius)) / 2, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionTopToBottom) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(0, (i * (segmentWidth + _segmentSeparation)), self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(0, (i * (segmentWidth + _segmentSeparation)), self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake((self.bounds.size.width - (2 * cornerRadius)) / 2, (i * (segmentWidth + _segmentSeparation)), 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
}
//Add the segment to the path
CGPathAddPath(pathRef, NULL, path.CGPath);
}
//Set the paths to the layer
_progressLayer.path = pathRef;
CGPathRelease(pathRef);
}
- (void)drawBackground
{
//Calculate the segment width (totalWidth - totalSeparationwidth / numberOfSegments
CGFloat segmentWidth = 0;
if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionLeftToRight || _progressDirection == M13ProgressViewSegmentedBarProgressDirectionRightToLeft) {
segmentWidth = (self.bounds.size.width - ((_numberOfSegments - 1) * _segmentSeparation)) / _numberOfSegments;
} else {
segmentWidth = (self.bounds.size.height - ((_numberOfSegments - 1) * _segmentSeparation)) / _numberOfSegments;
}
//Calculate the corner radius
CGFloat cornerRadius = 0;
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
cornerRadius = _cornerRadius;
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
cornerRadius = floorf(self.bounds.size.height < segmentWidth ? self.bounds.size.height / 2.0 : segmentWidth / 2.0);
}
//Create the path ref that all the paths will be appended
CGMutablePathRef pathRef = CGPathCreateMutable();
//Iterate through all the segments that are full.
for (int i = 0; i < _numberOfSegments - [self numberOfFullSegments]; i++) {
UIBezierPath *path = [UIBezierPath bezierPath];
//Move to top left of rectangle
if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionRightToLeft) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle || _segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), (self.bounds.size.height - (2 * cornerRadius)) / 2, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionLeftToRight) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, (self.bounds.size.height - (2 * cornerRadius)) / 2, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionTopToBottom) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(0, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(0, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake((self.bounds.size.width - (2 * cornerRadius)) / 2, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionBottomToTop) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(0, (i * (segmentWidth + _segmentSeparation)), self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(0, (i * (segmentWidth + _segmentSeparation)), self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake((self.bounds.size.width - (2 * cornerRadius)) / 2, (i * (segmentWidth + _segmentSeparation)), 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
}
//Add the segment to the path
CGPathAddPath(pathRef, NULL, path.CGPath);
}
//Set the paths to the layer
_backgroundLayer.path = pathRef;
CGPathRelease(pathRef);
}
- (void)drawIndeterminate
{
//Calculate the segment width (totalWidth - totalSeparationwidth / numberOfSegments
CGFloat segmentWidth = 0;
if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionLeftToRight || _progressDirection == M13ProgressViewSegmentedBarProgressDirectionRightToLeft) {
segmentWidth = (self.bounds.size.width - ((_numberOfSegments - 1) * _segmentSeparation)) / _numberOfSegments;
} else {
segmentWidth = (self.bounds.size.height - ((_numberOfSegments - 1) * _segmentSeparation)) / _numberOfSegments;
}
//Calculate the corner radius
CGFloat cornerRadius = 0;
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
cornerRadius = _cornerRadius;
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
cornerRadius = floorf(self.bounds.size.height < segmentWidth ? self.bounds.size.height / 2.0 : segmentWidth / 2.0);
}
//What index will the segments be colored from.
int numberOfSegmentsToBeColored = _numberOfSegments / 4;
//Create the path ref that all the paths will be appended
CGMutablePathRef progressPathRef = CGPathCreateMutable();
CGMutablePathRef backgroundPathRef = CGPathCreateMutable();
//Iterate through all the segments that are full.
for (int i = 0; i < _numberOfSegments; i++) {
@@ -523,21 +449,96 @@
}
}
//Add the segment to the proper path
//Add segment to the proper layer, and color it
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
layer.path = path.CGPath;
layer.fillColor = [self colorForSegment:i].CGColor;
}
}
- (void)drawIndeterminate
{
//Calculate the segment width (totalWidth - totalSeparationwidth / numberOfSegments
CGFloat segmentWidth = 0;
if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionLeftToRight || _progressDirection == M13ProgressViewSegmentedBarProgressDirectionRightToLeft) {
segmentWidth = (self.bounds.size.width - ((_numberOfSegments - 1) * _segmentSeparation)) / _numberOfSegments;
} else {
segmentWidth = (self.bounds.size.height - ((_numberOfSegments - 1) * _segmentSeparation)) / _numberOfSegments;
}
//Calculate the corner radius
CGFloat cornerRadius = 0;
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
cornerRadius = _cornerRadius;
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
cornerRadius = floorf(self.bounds.size.height < segmentWidth ? (float)self.bounds.size.height / 2.0f : (float)segmentWidth / 2.0f);
}
//What index will the segments be colored from.
NSInteger numberOfSegmentsToBeColored = _numberOfSegments / 4;
//Iterate through all the segments that are full.
for (int i = 0; i < _numberOfSegments; i++) {
UIBezierPath *path = [UIBezierPath bezierPath];
//Move to top left of rectangle
if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionLeftToRight) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake(i * (segmentWidth + _segmentSeparation), (self.bounds.size.height - (2 * cornerRadius)) / 2, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionRightToLeft) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 0, segmentWidth, self.bounds.size.height);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake(self.bounds.size.width - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, (self.bounds.size.height - (2 * cornerRadius)) / 2, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionBottomToTop) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(0, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(0, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake((self.bounds.size.width - (2 * cornerRadius)) / 2, self.bounds.size.height - (i * (segmentWidth + _segmentSeparation)) - segmentWidth, 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
} else if (_progressDirection == M13ProgressViewSegmentedBarProgressDirectionTopToBottom) {
if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRectangle) {
CGRect rect = CGRectMake(0, (i * (segmentWidth + _segmentSeparation)), self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRect:rect];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeRoundedRect) {
CGRect rect = CGRectMake(0, (i * (segmentWidth + _segmentSeparation)), self.bounds.size.width, segmentWidth);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
} else if (_segmentShape == M13ProgressViewSegmentedBarSegmentShapeCircle) {
CGRect rect = CGRectMake((self.bounds.size.width - (2 * cornerRadius)) / 2, (i * (segmentWidth + _segmentSeparation)), 2 * cornerRadius, 2 * cornerRadius);
path = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius];
}
}
//Add the segment to the proper path //Add segment to the proper layer, and color it
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
layer.path = path.CGPath;
if (i >= indeterminateIndex && i < indeterminateIndex + numberOfSegmentsToBeColored) {
CGPathAddPath(progressPathRef, NULL, path.CGPath);
layer.fillColor = ((UIColor *)segmentColorsPrimary[i]).CGColor;
} else {
CGPathAddPath(backgroundPathRef, NULL, path.CGPath);
layer.fillColor = ((UIColor *)segmentColorsBackground[i]).CGColor;
}
}
//Set the paths to the layer
_progressLayer.path = progressPathRef;
_backgroundLayer.path = backgroundPathRef;
CGPathRelease(progressPathRef);
CGPathRelease(backgroundPathRef);
//increase the index by one for movement
indeterminateIndex += 1;
if (indeterminateIndex == numberOfSegmentsToBeColored + _numberOfSegments) {
@@ -52,6 +52,8 @@
CGFloat _segmentSeparationInnerAngle;
}
@dynamic progress;
#pragma mark Initalization and setup
- (id)init
@@ -87,7 +89,7 @@
self.backgroundColor = [UIColor clearColor];
//Set defaut sizes
_progressRingWidth = fmaxf(self.bounds.size.width * .25, 1.0);
_progressRingWidth = fmaxf((float)self.bounds.size.width * .25f, 1.0);
_progressRingWidthOverriden = NO;
_segmentSeparationAngleOverriden = NO;
self.animationDuration = .3;
@@ -136,7 +138,8 @@
- (void)setPrimaryColor:(UIColor *)primaryColor
{
[super setPrimaryColor:primaryColor];
_progressLayer.strokeColor = self.primaryColor.CGColor;
_progressLayer.strokeColor = [[UIColor clearColor] CGColor];
_progressLayer.fillColor = self.primaryColor.CGColor;
_iconLayer.fillColor = self.primaryColor.CGColor;
[self setNeedsDisplay];
}
@@ -157,6 +160,7 @@
_progressRingWidthOverriden = YES;
[self updateAngles];
[self setNeedsDisplay];
[self invalidateIntrinsicContentSize];
}
- (void)setShowPercentage:(BOOL)showPercentage
@@ -206,7 +210,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:animated];
@@ -217,7 +221,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -229,18 +233,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -270,9 +274,9 @@
[CATransaction begin];
[_iconLayer addAnimation:[self hideAnimation] forKey:kM13ProgressViewSegmentedRingHideKey];
[CATransaction setCompletionBlock:^{
_currentAction = action;
self.currentAction = action;
[self drawIcon];
[_iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewSegmentedRingShowKey];
[self.iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewSegmentedRingShowKey];
}];
[CATransaction commit];
}
@@ -290,9 +294,9 @@
[CATransaction begin];
[_iconLayer addAnimation:[self hideAnimation] forKey:kM13ProgressViewSegmentedRingHideKey];
[CATransaction setCompletionBlock:^{
_currentAction = action;
self.currentAction = action;
[self drawIcon];
[_iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewSegmentedRingShowKey];
[self.iconLayer addAnimation:[self showAnimation] forKey:kM13ProgressViewSegmentedRingShowKey];
}];
[CATransaction commit];
}
@@ -306,13 +310,13 @@
//Create the rotation animation
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0];
rotationAnimation.toValue = [NSNumber numberWithFloat: (float)(M_PI * 2.0)];
rotationAnimation.duration = 5 * self.animationDuration;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = HUGE_VALF;
CABasicAnimation *rotationAnimationProgress = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimationProgress.toValue = [NSNumber numberWithFloat: M_PI * 2.0];
rotationAnimationProgress.toValue = [NSNumber numberWithFloat: (float)(M_PI * 2.0)];
rotationAnimationProgress.duration = 5 * self.animationDuration;
rotationAnimationProgress.cumulative = YES;
rotationAnimationProgress.repeatCount = HUGE_VALF;
@@ -329,8 +333,8 @@
[_percentageLabel.layer addAnimation:[self showAnimation] forKey:kM13ProgressViewSegmentedRingShowKey];
[CATransaction setCompletionBlock:^{
//Remove the rotation animation and reset the background
[_backgroundLayer removeAnimationForKey:@"rotationAnimation"];
[_progressLayer removeAnimationForKey:@"rotationAnimation"];
[self.backgroundLayer removeAnimationForKey:@"rotationAnimation"];
[self.progressLayer removeAnimationForKey:@"rotationAnimation"];
[self drawBackground];
[self drawProgress];
}];
@@ -380,7 +384,7 @@
//Update line widths if not overriden
if (!_progressRingWidthOverriden) {
_progressRingWidth = fmaxf(self.frame.size.width * .25, 1.0);
_progressRingWidth = fmaxf((float)(self.frame.size.width * .25), 1.0);
}
[self updateAngles];
@@ -389,6 +393,14 @@
[self setNeedsDisplay];
}
- (CGSize)intrinsicContentSize
{
//This might need a little more fine tuning.
CGFloat base = _progressRingWidth * 2;
return CGSizeMake(base, base);
}
- (void)setFrame:(CGRect)frame
{
//Keep the progress view square.
@@ -406,14 +418,14 @@
//Calculate the outer ring angle for the progress segment.*/
outerRingAngle = ((2.0 * M_PI) / (float)_numberOfSegments) - _segmentSeparationAngle;
//Calculate the angle gap for the inner ring
_segmentSeparationInnerAngle = 2.0 * asinf(((self.bounds.size.width / 2.0) * sinf(_segmentSeparationAngle / 2.0)) / ((self.bounds.size.width / 2.0) - _progressRingWidth));
_segmentSeparationInnerAngle = 2.0f * asinf((float)((self.bounds.size.width / 2.0) * sinf((float)_segmentSeparationAngle / 2.0f)) / (((float)self.bounds.size.width / 2.0f) - (float)_progressRingWidth));
//Calculate the inner ring angle for the progress segment.*/
innerRingAngle = ((2.0 * M_PI) / (float)_numberOfSegments) - _segmentSeparationInnerAngle;
}
- (NSInteger)numberOfFullSegments
{
return (NSInteger)floorf(self.progress * _numberOfSegments);
return (NSInteger)floorf((float)(self.progress * _numberOfSegments));
}
#pragma mark Drawing
@@ -573,7 +585,7 @@
CGPathRelease(pathRef);
//Update label
_percentageLabel.text = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:self.progress]];
_percentageLabel.text = [_percentageFormatter stringFromNumber:[NSNumber numberWithFloat:(float)self.progress]];
}
- (void)drawIcon
@@ -39,7 +39,7 @@
/**The action currently being performed.*/
@property (nonatomic, assign) M13ProgressViewAction currentAction;
/**The stripes layer.*/
@property (nonatomic, retain) CAShapeLayer *stripesLayer;
@property (nonatomic, retain) CALayer *stripesLayer;
@end
@implementation M13ProgressViewStripedBar
@@ -47,6 +47,8 @@
UIColor *_currentColor;
}
@dynamic progress;
#pragma mark Initalization and setup
- (id)init
@@ -165,12 +167,15 @@
- (void)setStripeWidth:(CGFloat)stripeWidth
{
_stripeWidth = stripeWidth;
[self invalidateIntrinsicContentSize];
[self setNeedsDisplay];
}
- (void)setBorderWidth:(CGFloat)borderWidth
{
_borderWidth = borderWidth;
_backgroundLayer.lineWidth = borderWidth;
[self invalidateIntrinsicContentSize];
[self setNeedsDisplay];
}
@@ -208,7 +213,7 @@
if (animated == NO) {
if (_displayLink) {
//Kill running animations
[_displayLink removeFromRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
[_displayLink invalidate];
_displayLink = nil;
}
[super setProgress:progress animated:NO];
@@ -219,7 +224,7 @@
_animationToValue = progress;
if (!_displayLink) {
//Create and setup the display link
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(animateProgress:)];
[self.displayLink addToRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
} /*else {
@@ -231,18 +236,18 @@
- (void)animateProgress:(CADisplayLink *)displayLink
{
dispatch_async(dispatch_get_main_queue(), ^{
CGFloat dt = (displayLink.timestamp - _animationStartTime) / self.animationDuration;
CGFloat dt = (displayLink.timestamp - self.animationStartTime) / self.animationDuration;
if (dt >= 1.0) {
//Order is important! Otherwise concurrency will cause errors, because setProgress: will detect an animation in progress and try to stop it by itself. Once over one, set to actual progress amount. Animation is over.
[self.displayLink removeFromRunLoop:NSRunLoop.mainRunLoop forMode:NSRunLoopCommonModes];
[self.displayLink invalidate];
self.displayLink = nil;
[super setProgress:_animationToValue animated:NO];
[super setProgress:self.animationToValue animated:NO];
[self setNeedsDisplay];
return;
}
//Set progress
[super setProgress:_animationFromValue + dt * (_animationToValue - _animationFromValue) animated:YES];
[super setProgress:self.animationFromValue + dt * (self.animationToValue - self.animationFromValue) animated:YES];
[self setNeedsDisplay];
});
@@ -280,6 +285,15 @@
[self drawStripes];
}
- (CGSize)intrinsicContentSize
{
//Border + border to progress bar margin.
CGFloat base = (_borderWidth * 2) + (_borderWidth * 2) + 1;
//Add some stripes so we can see them.
CGFloat width = base + (2 * _stripeWidth);
return CGSizeMake(width, base);
}
#pragma mark Drawing
- (void)drawRect:(CGRect)rect
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "M13ProgressSuite"
s.version = "1.2.4"
s.version = "1.2.9"
s.summary = "A suite containing many tools to display progress information on iOS."
s.description = <<-DESC
@@ -27,7 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
s.platform = :ios, '7.0'
s.source = { :git => "https://github.com/Marxon13/M13ProgressSuite.git", :tag => "v1.2.4"}
s.source = { :git => "https://github.com/Marxon13/M13ProgressSuite.git", :tag => "v1.2.9"}
s.source_files = 'Classes/*/*'
+288 -53
View File
@@ -21,7 +21,7 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
CA1C945E18CCF59500B469BF /* M13ProgressViewMetroDotPolygon.m in Sources */ = {isa = PBXBuildFile; fileRef = CA1C945D18CCF59500B469BF /* M13ProgressViewMetroDotPolygon.m */; };
62BB86011C87300F0019306A /* UIApplication+M13ProgressSuite.m in Sources */ = {isa = PBXBuildFile; fileRef = 62BB86001C87300F0019306A /* UIApplication+M13ProgressSuite.m */; };
CA2FAF9C1889907300BCAEF5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FAF9B1889907300BCAEF5 /* Foundation.framework */; };
CA2FAF9E1889907300BCAEF5 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FAF9D1889907300BCAEF5 /* CoreGraphics.framework */; };
CA2FAFA01889907300BCAEF5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FAF9F1889907300BCAEF5 /* UIKit.framework */; };
@@ -36,19 +36,6 @@
CA2FAFC01889907300BCAEF5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FAF9F1889907300BCAEF5 /* UIKit.framework */; };
CA2FAFC81889907300BCAEF5 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = CA2FAFC61889907300BCAEF5 /* InfoPlist.strings */; };
CA2FAFCA1889907300BCAEF5 /* M13ProgressSuiteTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFC91889907300BCAEF5 /* M13ProgressSuiteTests.m */; };
CA2FAFD71889933200BCAEF5 /* UINavigationController+M13ProgressViewBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFD61889933200BCAEF5 /* UINavigationController+M13ProgressViewBar.m */; };
CA2FAFDA1889933F00BCAEF5 /* M13ProgressConsole.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFD91889933F00BCAEF5 /* M13ProgressConsole.m */; };
CA2FAFDE1889935400BCAEF5 /* M13ProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFDD1889935400BCAEF5 /* M13ProgressHUD.m */; };
CA2FAFF51889937800BCAEF5 /* M13ProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFE21889937800BCAEF5 /* M13ProgressView.m */; };
CA2FAFF61889937800BCAEF5 /* M13ProgressViewBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFE41889937800BCAEF5 /* M13ProgressViewBar.m */; };
CA2FAFF71889937800BCAEF5 /* M13ProgressViewBorderedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFE61889937800BCAEF5 /* M13ProgressViewBorderedBar.m */; };
CA2FAFF81889937800BCAEF5 /* M13ProgressViewFilteredImage.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFE81889937800BCAEF5 /* M13ProgressViewFilteredImage.m */; };
CA2FAFF91889937800BCAEF5 /* M13ProgressViewImage.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFEA1889937800BCAEF5 /* M13ProgressViewImage.m */; };
CA2FAFFA1889937800BCAEF5 /* M13ProgressViewPie.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFEC1889937800BCAEF5 /* M13ProgressViewPie.m */; };
CA2FAFFB1889937800BCAEF5 /* M13ProgressViewRing.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFEE1889937800BCAEF5 /* M13ProgressViewRing.m */; };
CA2FAFFC1889937800BCAEF5 /* M13ProgressViewSegmentedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFF01889937800BCAEF5 /* M13ProgressViewSegmentedBar.m */; };
CA2FAFFD1889937800BCAEF5 /* M13ProgressViewSegmentedRing.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFF21889937800BCAEF5 /* M13ProgressViewSegmentedRing.m */; };
CA2FAFFE1889937800BCAEF5 /* M13ProgressViewStripedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFF41889937800BCAEF5 /* M13ProgressViewStripedBar.m */; };
CA2FB0221889946F00BCAEF5 /* BarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB0091889946F00BCAEF5 /* BarViewController.m */; };
CA2FB0231889946F00BCAEF5 /* BorderedBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB00B1889946F00BCAEF5 /* BorderedBarViewController.m */; };
CA2FB0241889946F00BCAEF5 /* ConsoleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB00D1889946F00BCAEF5 /* ConsoleViewController.m */; };
@@ -62,18 +49,53 @@
CA2FB02C1889946F00BCAEF5 /* SegmentedBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB01D1889946F00BCAEF5 /* SegmentedBarViewController.m */; };
CA2FB02D1889946F00BCAEF5 /* SegmentedRingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB01F1889946F00BCAEF5 /* SegmentedRingViewController.m */; };
CA2FB02E1889946F00BCAEF5 /* StripedBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB0211889946F00BCAEF5 /* StripedBarViewController.m */; };
CA2FB032188994B700BCAEF5 /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FB031188994B700BCAEF5 /* UIImage+ImageEffects.m */; };
CA2FB0361889952E00BCAEF5 /* Galaxy.jpg in Resources */ = {isa = PBXBuildFile; fileRef = CA2FB0341889952E00BCAEF5 /* Galaxy.jpg */; };
CA2FB0371889952E00BCAEF5 /* Striped_apple_logo.png in Resources */ = {isa = PBXBuildFile; fileRef = CA2FB0351889952E00BCAEF5 /* Striped_apple_logo.png */; };
CA2FB03A1889974600BCAEF5 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FB0391889974600BCAEF5 /* Accelerate.framework */; };
CA2FB03C1889975400BCAEF5 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FB03B1889975400BCAEF5 /* CoreImage.framework */; };
CA2FB03E1889975A00BCAEF5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CA2FB03D1889975A00BCAEF5 /* QuartzCore.framework */; };
CA412B0218D252FE00FCB7CC /* M13ProgressViewRadiative.m in Sources */ = {isa = PBXBuildFile; fileRef = CA412B0118D252FE00FCB7CC /* M13ProgressViewRadiative.m */; };
CA412B0518D2638E00FCB7CC /* RadiativeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA412B0418D2638E00FCB7CC /* RadiativeViewController.m */; };
CA66890318CBBD1400827C48 /* M13ProgressViewMetro.m in Sources */ = {isa = PBXBuildFile; fileRef = CA66890218CBBD1400827C48 /* M13ProgressViewMetro.m */; };
CA66890618CBEF9300827C48 /* MetroViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA66890518CBEF9300827C48 /* MetroViewController.m */; };
CA6F31C3190EA88D008D1E64 /* M13ProgressViewLetterpress.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6F31C2190EA88D008D1E64 /* M13ProgressViewLetterpress.m */; };
CA6F31C7190EBF11008D1E64 /* LetterpressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6F31C6190EBF11008D1E64 /* LetterpressViewController.m */; };
FB2A7BE11B793E5600FE4E4A /* M13ProgressSuite.h in Headers */ = {isa = PBXBuildFile; fileRef = FB2A7BE01B793E5600FE4E4A /* M13ProgressSuite.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7BF31B793E5600FE4E4A /* M13ProgressSuite.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuite.framework */; };
FB2A7BF41B793E5600FE4E4A /* M13ProgressSuite.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuite.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
FB2A7BFC1B793E6B00FE4E4A /* M13ProgressView.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFE11889937800BCAEF5 /* M13ProgressView.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7BFD1B793E6B00FE4E4A /* M13ProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFE21889937800BCAEF5 /* M13ProgressView.m */; };
FB2A7BFE1B793E6B00FE4E4A /* M13ProgressViewBar.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFE31889937800BCAEF5 /* M13ProgressViewBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7BFF1B793E6B00FE4E4A /* M13ProgressViewBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFE41889937800BCAEF5 /* M13ProgressViewBar.m */; };
FB2A7C001B793E6B00FE4E4A /* M13ProgressViewBorderedBar.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFE51889937800BCAEF5 /* M13ProgressViewBorderedBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C011B793E6B00FE4E4A /* M13ProgressViewBorderedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFE61889937800BCAEF5 /* M13ProgressViewBorderedBar.m */; };
FB2A7C021B793E6B00FE4E4A /* M13ProgressViewFilteredImage.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFE71889937800BCAEF5 /* M13ProgressViewFilteredImage.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C031B793E6B00FE4E4A /* M13ProgressViewFilteredImage.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFE81889937800BCAEF5 /* M13ProgressViewFilteredImage.m */; };
FB2A7C041B793E6B00FE4E4A /* M13ProgressViewImage.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFE91889937800BCAEF5 /* M13ProgressViewImage.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C051B793E6B00FE4E4A /* M13ProgressViewImage.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFEA1889937800BCAEF5 /* M13ProgressViewImage.m */; };
FB2A7C061B793E6B00FE4E4A /* M13ProgressViewPie.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFEB1889937800BCAEF5 /* M13ProgressViewPie.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C071B793E6B00FE4E4A /* M13ProgressViewPie.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFEC1889937800BCAEF5 /* M13ProgressViewPie.m */; };
FB2A7C081B793E6B00FE4E4A /* M13ProgressViewRing.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFED1889937800BCAEF5 /* M13ProgressViewRing.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C091B793E6B00FE4E4A /* M13ProgressViewRing.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFEE1889937800BCAEF5 /* M13ProgressViewRing.m */; };
FB2A7C0A1B793E6B00FE4E4A /* M13ProgressViewSegmentedBar.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFEF1889937800BCAEF5 /* M13ProgressViewSegmentedBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C0B1B793E6B00FE4E4A /* M13ProgressViewSegmentedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFF01889937800BCAEF5 /* M13ProgressViewSegmentedBar.m */; };
FB2A7C0C1B793E6B00FE4E4A /* M13ProgressViewSegmentedRing.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFF11889937800BCAEF5 /* M13ProgressViewSegmentedRing.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C0D1B793E6B00FE4E4A /* M13ProgressViewSegmentedRing.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFF21889937800BCAEF5 /* M13ProgressViewSegmentedRing.m */; };
FB2A7C0E1B793E6B00FE4E4A /* M13ProgressViewStripedBar.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFF31889937800BCAEF5 /* M13ProgressViewStripedBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C0F1B793E6B00FE4E4A /* M13ProgressViewStripedBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFF41889937800BCAEF5 /* M13ProgressViewStripedBar.m */; };
FB2A7C101B793E6B00FE4E4A /* M13ProgressViewMetro.h in Headers */ = {isa = PBXBuildFile; fileRef = CA66890118CBBD1400827C48 /* M13ProgressViewMetro.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C111B793E6B00FE4E4A /* M13ProgressViewMetro.m in Sources */ = {isa = PBXBuildFile; fileRef = CA66890218CBBD1400827C48 /* M13ProgressViewMetro.m */; };
FB2A7C121B793E6B00FE4E4A /* M13ProgressViewMetroDotPolygon.h in Headers */ = {isa = PBXBuildFile; fileRef = CA1C945C18CCF59500B469BF /* M13ProgressViewMetroDotPolygon.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C131B793E6B00FE4E4A /* M13ProgressViewMetroDotPolygon.m in Sources */ = {isa = PBXBuildFile; fileRef = CA1C945D18CCF59500B469BF /* M13ProgressViewMetroDotPolygon.m */; };
FB2A7C141B793E6B00FE4E4A /* M13ProgressViewRadiative.h in Headers */ = {isa = PBXBuildFile; fileRef = CA412B0018D252FE00FCB7CC /* M13ProgressViewRadiative.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C151B793E6B00FE4E4A /* M13ProgressViewRadiative.m in Sources */ = {isa = PBXBuildFile; fileRef = CA412B0118D252FE00FCB7CC /* M13ProgressViewRadiative.m */; };
FB2A7C161B793E6B00FE4E4A /* M13ProgressViewLetterpress.h in Headers */ = {isa = PBXBuildFile; fileRef = CA6F31C1190EA88D008D1E64 /* M13ProgressViewLetterpress.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C171B793E6B00FE4E4A /* M13ProgressViewLetterpress.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6F31C2190EA88D008D1E64 /* M13ProgressViewLetterpress.m */; };
FB2A7C181B793E6B00FE4E4A /* UIImage+ImageEffects.h in Headers */ = {isa = PBXBuildFile; fileRef = CA42BE271A12A92F0018E53E /* UIImage+ImageEffects.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C191B793E6B00FE4E4A /* UIImage+ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = CA42BE281A12A92F0018E53E /* UIImage+ImageEffects.m */; };
FB2A7C1A1B793E6B00FE4E4A /* M13ProgressHUD.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFDC1889935400BCAEF5 /* M13ProgressHUD.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C1B1B793E6B00FE4E4A /* M13ProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFDD1889935400BCAEF5 /* M13ProgressHUD.m */; };
FB2A7C1C1B793E6B00FE4E4A /* M13ProgressConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFD81889933F00BCAEF5 /* M13ProgressConsole.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C1D1B793E6B00FE4E4A /* M13ProgressConsole.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFD91889933F00BCAEF5 /* M13ProgressConsole.m */; };
FB2A7C1E1B793E6B00FE4E4A /* UINavigationController+M13ProgressViewBar.h in Headers */ = {isa = PBXBuildFile; fileRef = CA2FAFD51889933200BCAEF5 /* UINavigationController+M13ProgressViewBar.h */; settings = {ATTRIBUTES = (Public, ); }; };
FB2A7C1F1B793E6B00FE4E4A /* UINavigationController+M13ProgressViewBar.m in Sources */ = {isa = PBXBuildFile; fileRef = CA2FAFD61889933200BCAEF5 /* UINavigationController+M13ProgressViewBar.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -84,12 +106,35 @@
remoteGlobalIDString = CA2FAF971889907300BCAEF5;
remoteInfo = M13ProgressSuite;
};
FB2A7BF11B793E5600FE4E4A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = CA2FAF901889907300BCAEF5 /* Project object */;
proxyType = 1;
remoteGlobalIDString = FB2A7BDB1B793E5600FE4E4A;
remoteInfo = M13ProgressSuiteFramework;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
FB2A7BFA1B793E5600FE4E4A /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
FB2A7BF41B793E5600FE4E4A /* M13ProgressSuite.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
62BB85FF1C87300F0019306A /* UIApplication+M13ProgressSuite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIApplication+M13ProgressSuite.h"; path = "Classes/Application/UIApplication+M13ProgressSuite.h"; sourceTree = "<group>"; };
62BB86001C87300F0019306A /* UIApplication+M13ProgressSuite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIApplication+M13ProgressSuite.m"; path = "Classes/Application/UIApplication+M13ProgressSuite.m"; sourceTree = "<group>"; };
CA1C945C18CCF59500B469BF /* M13ProgressViewMetroDotPolygon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewMetroDotPolygon.h; path = Classes/ProgressViews/M13ProgressViewMetroDotPolygon.h; sourceTree = "<group>"; };
CA1C945D18CCF59500B469BF /* M13ProgressViewMetroDotPolygon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewMetroDotPolygon.m; path = Classes/ProgressViews/M13ProgressViewMetroDotPolygon.m; sourceTree = "<group>"; };
CA2FAF981889907300BCAEF5 /* M13ProgressSuite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = M13ProgressSuite.app; sourceTree = BUILT_PRODUCTS_DIR; };
CA2FAF981889907300BCAEF5 /* M13ProgressSuiteDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = M13ProgressSuiteDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
CA2FAF9B1889907300BCAEF5 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
CA2FAF9D1889907300BCAEF5 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
CA2FAF9F1889907300BCAEF5 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
@@ -159,8 +204,6 @@
CA2FB01F1889946F00BCAEF5 /* SegmentedRingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SegmentedRingViewController.m; sourceTree = "<group>"; };
CA2FB0201889946F00BCAEF5 /* StripedBarViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StripedBarViewController.h; sourceTree = "<group>"; };
CA2FB0211889946F00BCAEF5 /* StripedBarViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StripedBarViewController.m; sourceTree = "<group>"; };
CA2FB030188994B700BCAEF5 /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+ImageEffects.h"; path = "Classes/HUD/UIImage+ImageEffects.h"; sourceTree = "<group>"; };
CA2FB031188994B700BCAEF5 /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+ImageEffects.m"; path = "Classes/HUD/UIImage+ImageEffects.m"; sourceTree = "<group>"; };
CA2FB0341889952E00BCAEF5 /* Galaxy.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Galaxy.jpg; path = M13ProgressSuite/Galaxy.jpg; sourceTree = "<group>"; };
CA2FB0351889952E00BCAEF5 /* Striped_apple_logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Striped_apple_logo.png; path = M13ProgressSuite/Striped_apple_logo.png; sourceTree = "<group>"; };
CA2FB0391889974600BCAEF5 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
@@ -170,6 +213,8 @@
CA412B0118D252FE00FCB7CC /* M13ProgressViewRadiative.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewRadiative.m; path = Classes/ProgressViews/M13ProgressViewRadiative.m; sourceTree = "<group>"; };
CA412B0318D2638E00FCB7CC /* RadiativeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RadiativeViewController.h; sourceTree = "<group>"; };
CA412B0418D2638E00FCB7CC /* RadiativeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RadiativeViewController.m; sourceTree = "<group>"; };
CA42BE271A12A92F0018E53E /* UIImage+ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+ImageEffects.h"; path = "Classes/HUD/UIImage+ImageEffects.h"; sourceTree = "<group>"; };
CA42BE281A12A92F0018E53E /* UIImage+ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+ImageEffects.m"; path = "Classes/HUD/UIImage+ImageEffects.m"; sourceTree = "<group>"; };
CA66890118CBBD1400827C48 /* M13ProgressViewMetro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = M13ProgressViewMetro.h; path = Classes/ProgressViews/M13ProgressViewMetro.h; sourceTree = "<group>"; };
CA66890218CBBD1400827C48 /* M13ProgressViewMetro.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewMetro.m; path = Classes/ProgressViews/M13ProgressViewMetro.m; sourceTree = "<group>"; };
CA66890418CBEF9300827C48 /* MetroViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MetroViewController.h; sourceTree = "<group>"; };
@@ -178,6 +223,9 @@
CA6F31C2190EA88D008D1E64 /* M13ProgressViewLetterpress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = M13ProgressViewLetterpress.m; path = Classes/ProgressViews/M13ProgressViewLetterpress.m; sourceTree = "<group>"; };
CA6F31C5190EBF11008D1E64 /* LetterpressViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LetterpressViewController.h; sourceTree = "<group>"; };
CA6F31C6190EBF11008D1E64 /* LetterpressViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LetterpressViewController.m; sourceTree = "<group>"; };
FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuite.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = M13ProgressSuite.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FB2A7BDF1B793E5600FE4E4A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
FB2A7BE01B793E5600FE4E4A /* M13ProgressSuite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = M13ProgressSuite.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -186,6 +234,7 @@
buildActionMask = 2147483647;
files = (
CA2FAF9E1889907300BCAEF5 /* CoreGraphics.framework in Frameworks */,
FB2A7BF31B793E5600FE4E4A /* M13ProgressSuite.framework in Frameworks */,
CA2FB03E1889975A00BCAEF5 /* QuartzCore.framework in Frameworks */,
CA2FB03C1889975400BCAEF5 /* CoreImage.framework in Frameworks */,
CA2FB03A1889974600BCAEF5 /* Accelerate.framework in Frameworks */,
@@ -204,16 +253,33 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
FB2A7BD81B793E5600FE4E4A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
62BB85FE1C872FF50019306A /* M13ProgressApplication */ = {
isa = PBXGroup;
children = (
62BB85FF1C87300F0019306A /* UIApplication+M13ProgressSuite.h */,
62BB86001C87300F0019306A /* UIApplication+M13ProgressSuite.m */,
);
name = M13ProgressApplication;
sourceTree = "<group>";
};
CA2FAF8F1889907300BCAEF5 = {
isa = PBXGroup;
children = (
CA2FAFD31889924500BCAEF5 /* Classes */,
CA2FAFA11889907300BCAEF5 /* M13ProgressSuite */,
CA2FB033188994E200BCAEF5 /* Images */,
CA2FAFA11889907300BCAEF5 /* M13ProgressSuite */,
CA2FAFC31889907300BCAEF5 /* M13ProgressSuiteTests */,
FB2A7BDD1B793E5600FE4E4A /* M13ProgressSuiteFramework */,
CA2FAF9A1889907300BCAEF5 /* Frameworks */,
CA2FAF991889907300BCAEF5 /* Products */,
);
@@ -222,8 +288,9 @@
CA2FAF991889907300BCAEF5 /* Products */ = {
isa = PBXGroup;
children = (
CA2FAF981889907300BCAEF5 /* M13ProgressSuite.app */,
CA2FAF981889907300BCAEF5 /* M13ProgressSuiteDemo.app */,
CA2FAFBC1889907300BCAEF5 /* M13ProgressSuiteTests.xctest */,
FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuite.framework */,
);
name = Products;
sourceTree = "<group>";
@@ -292,6 +359,7 @@
CA2FAFDF1889935700BCAEF5 /* HUD */,
CA2FAFDB1889934300BCAEF5 /* Console */,
CA2FAFD41889928200BCAEF5 /* M13ProgressNavigationController */,
62BB85FE1C872FF50019306A /* M13ProgressApplication */,
);
name = Classes;
sourceTree = "<group>";
@@ -317,8 +385,8 @@
CA2FAFDF1889935700BCAEF5 /* HUD */ = {
isa = PBXGroup;
children = (
CA2FB030188994B700BCAEF5 /* UIImage+ImageEffects.h */,
CA2FB031188994B700BCAEF5 /* UIImage+ImageEffects.m */,
CA42BE271A12A92F0018E53E /* UIImage+ImageEffects.h */,
CA42BE281A12A92F0018E53E /* UIImage+ImageEffects.m */,
CA2FAFDC1889935400BCAEF5 /* M13ProgressHUD.h */,
CA2FAFDD1889935400BCAEF5 /* M13ProgressHUD.m */,
);
@@ -512,24 +580,72 @@
name = Letterpress;
sourceTree = "<group>";
};
FB2A7BDD1B793E5600FE4E4A /* M13ProgressSuiteFramework */ = {
isa = PBXGroup;
children = (
FB2A7BE01B793E5600FE4E4A /* M13ProgressSuite.h */,
FB2A7BDE1B793E5600FE4E4A /* Supporting Files */,
);
path = M13ProgressSuiteFramework;
sourceTree = "<group>";
};
FB2A7BDE1B793E5600FE4E4A /* Supporting Files */ = {
isa = PBXGroup;
children = (
FB2A7BDF1B793E5600FE4E4A /* Info.plist */,
);
name = "Supporting Files";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
FB2A7BD91B793E5600FE4E4A /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
FB2A7BE11B793E5600FE4E4A /* M13ProgressSuite.h in Headers */,
FB2A7BFC1B793E6B00FE4E4A /* M13ProgressView.h in Headers */,
FB2A7BFE1B793E6B00FE4E4A /* M13ProgressViewBar.h in Headers */,
FB2A7C001B793E6B00FE4E4A /* M13ProgressViewBorderedBar.h in Headers */,
FB2A7C021B793E6B00FE4E4A /* M13ProgressViewFilteredImage.h in Headers */,
FB2A7C041B793E6B00FE4E4A /* M13ProgressViewImage.h in Headers */,
FB2A7C061B793E6B00FE4E4A /* M13ProgressViewPie.h in Headers */,
FB2A7C081B793E6B00FE4E4A /* M13ProgressViewRing.h in Headers */,
FB2A7C0A1B793E6B00FE4E4A /* M13ProgressViewSegmentedBar.h in Headers */,
FB2A7C0C1B793E6B00FE4E4A /* M13ProgressViewSegmentedRing.h in Headers */,
FB2A7C0E1B793E6B00FE4E4A /* M13ProgressViewStripedBar.h in Headers */,
FB2A7C101B793E6B00FE4E4A /* M13ProgressViewMetro.h in Headers */,
FB2A7C121B793E6B00FE4E4A /* M13ProgressViewMetroDotPolygon.h in Headers */,
FB2A7C141B793E6B00FE4E4A /* M13ProgressViewRadiative.h in Headers */,
FB2A7C161B793E6B00FE4E4A /* M13ProgressViewLetterpress.h in Headers */,
FB2A7C181B793E6B00FE4E4A /* UIImage+ImageEffects.h in Headers */,
FB2A7C1A1B793E6B00FE4E4A /* M13ProgressHUD.h in Headers */,
FB2A7C1C1B793E6B00FE4E4A /* M13ProgressConsole.h in Headers */,
FB2A7C1E1B793E6B00FE4E4A /* UINavigationController+M13ProgressViewBar.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
CA2FAF971889907300BCAEF5 /* M13ProgressSuite */ = {
CA2FAF971889907300BCAEF5 /* M13ProgressSuiteDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = CA2FAFCD1889907300BCAEF5 /* Build configuration list for PBXNativeTarget "M13ProgressSuite" */;
buildConfigurationList = CA2FAFCD1889907300BCAEF5 /* Build configuration list for PBXNativeTarget "M13ProgressSuiteDemo" */;
buildPhases = (
CA2FAF941889907300BCAEF5 /* Sources */,
CA2FAF951889907300BCAEF5 /* Frameworks */,
CA2FAF961889907300BCAEF5 /* Resources */,
FB2A7BFA1B793E5600FE4E4A /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
FB2A7BF21B793E5600FE4E4A /* PBXTargetDependency */,
);
name = M13ProgressSuite;
name = M13ProgressSuiteDemo;
productName = M13ProgressSuite;
productReference = CA2FAF981889907300BCAEF5 /* M13ProgressSuite.app */;
productReference = CA2FAF981889907300BCAEF5 /* M13ProgressSuiteDemo.app */;
productType = "com.apple.product-type.application";
};
CA2FAFBB1889907300BCAEF5 /* M13ProgressSuiteTests */ = {
@@ -550,18 +666,39 @@
productReference = CA2FAFBC1889907300BCAEF5 /* M13ProgressSuiteTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
FB2A7BDB1B793E5600FE4E4A /* M13ProgressSuiteFramework */ = {
isa = PBXNativeTarget;
buildConfigurationList = FB2A7BF91B793E5600FE4E4A /* Build configuration list for PBXNativeTarget "M13ProgressSuiteFramework" */;
buildPhases = (
FB2A7BD71B793E5600FE4E4A /* Sources */,
FB2A7BD81B793E5600FE4E4A /* Frameworks */,
FB2A7BD91B793E5600FE4E4A /* Headers */,
FB2A7BDA1B793E5600FE4E4A /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = M13ProgressSuiteFramework;
productName = M13ProgressSuiteFramework;
productReference = FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuite.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
CA2FAF901889907300BCAEF5 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0510;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "Brandon McQuilkin";
TargetAttributes = {
CA2FAFBB1889907300BCAEF5 = {
TestTargetID = CA2FAF971889907300BCAEF5;
};
FB2A7BDB1B793E5600FE4E4A = {
CreatedOnToolsVersion = 6.4;
};
};
};
buildConfigurationList = CA2FAF931889907300BCAEF5 /* Build configuration list for PBXProject "M13ProgressSuite" */;
@@ -577,8 +714,9 @@
projectDirPath = "";
projectRoot = "";
targets = (
CA2FAF971889907300BCAEF5 /* M13ProgressSuite */,
CA2FAF971889907300BCAEF5 /* M13ProgressSuiteDemo */,
CA2FAFBB1889907300BCAEF5 /* M13ProgressSuiteTests */,
FB2A7BDB1B793E5600FE4E4A /* M13ProgressSuiteFramework */,
CA2FB0431889986D00BCAEF5 /* Documentation */,
);
};
@@ -606,6 +744,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
FB2A7BDA1B793E5600FE4E4A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@@ -629,42 +774,25 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
62BB86011C87300F0019306A /* UIApplication+M13ProgressSuite.m in Sources */,
CA2FB02B1889946F00BCAEF5 /* SampleViewController.m in Sources */,
CA2FAFF51889937800BCAEF5 /* M13ProgressView.m in Sources */,
CA6F31C7190EBF11008D1E64 /* LetterpressViewController.m in Sources */,
CA6F31C3190EA88D008D1E64 /* M13ProgressViewLetterpress.m in Sources */,
CA2FAFDA1889933F00BCAEF5 /* M13ProgressConsole.m in Sources */,
CA2FB0221889946F00BCAEF5 /* BarViewController.m in Sources */,
CA2FAFDE1889935400BCAEF5 /* M13ProgressHUD.m in Sources */,
CA2FB0271889946F00BCAEF5 /* M13ProgressViewBarNavigationControllerViewController.m in Sources */,
CA412B0518D2638E00FCB7CC /* RadiativeViewController.m in Sources */,
CA2FB0291889946F00BCAEF5 /* ProgressHUDViewController.m in Sources */,
CA2FB02A1889946F00BCAEF5 /* RingViewController.m in Sources */,
CA2FAFF81889937800BCAEF5 /* M13ProgressViewFilteredImage.m in Sources */,
CA2FAFFD1889937800BCAEF5 /* M13ProgressViewSegmentedRing.m in Sources */,
CA2FAFF91889937800BCAEF5 /* M13ProgressViewImage.m in Sources */,
CA66890318CBBD1400827C48 /* M13ProgressViewMetro.m in Sources */,
CA2FB02C1889946F00BCAEF5 /* SegmentedBarViewController.m in Sources */,
CA2FAFFE1889937800BCAEF5 /* M13ProgressViewStripedBar.m in Sources */,
CA66890618CBEF9300827C48 /* MetroViewController.m in Sources */,
CA2FAFFA1889937800BCAEF5 /* M13ProgressViewPie.m in Sources */,
CA2FB032188994B700BCAEF5 /* UIImage+ImageEffects.m in Sources */,
CA2FAFD71889933200BCAEF5 /* UINavigationController+M13ProgressViewBar.m in Sources */,
CA2FB0281889946F00BCAEF5 /* PieViewController.m in Sources */,
CA2FB0261889946F00BCAEF5 /* ImageViewController.m in Sources */,
CA2FAFF61889937800BCAEF5 /* M13ProgressViewBar.m in Sources */,
CA2FB0231889946F00BCAEF5 /* BorderedBarViewController.m in Sources */,
CA2FAFAC1889907300BCAEF5 /* AppDelegate.m in Sources */,
CA2FAFA81889907300BCAEF5 /* main.m in Sources */,
CA2FB0251889946F00BCAEF5 /* FilteredImageViewController.m in Sources */,
CA1C945E18CCF59500B469BF /* M13ProgressViewMetroDotPolygon.m in Sources */,
CA2FB0241889946F00BCAEF5 /* ConsoleViewController.m in Sources */,
CA2FAFF71889937800BCAEF5 /* M13ProgressViewBorderedBar.m in Sources */,
CA2FB02E1889946F00BCAEF5 /* StripedBarViewController.m in Sources */,
CA2FAFFC1889937800BCAEF5 /* M13ProgressViewSegmentedBar.m in Sources */,
CA412B0218D252FE00FCB7CC /* M13ProgressViewRadiative.m in Sources */,
CA2FB02D1889946F00BCAEF5 /* SegmentedRingViewController.m in Sources */,
CA2FAFFB1889937800BCAEF5 /* M13ProgressViewRing.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -676,14 +804,44 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
FB2A7BD71B793E5600FE4E4A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FB2A7BFD1B793E6B00FE4E4A /* M13ProgressView.m in Sources */,
FB2A7BFF1B793E6B00FE4E4A /* M13ProgressViewBar.m in Sources */,
FB2A7C011B793E6B00FE4E4A /* M13ProgressViewBorderedBar.m in Sources */,
FB2A7C031B793E6B00FE4E4A /* M13ProgressViewFilteredImage.m in Sources */,
FB2A7C051B793E6B00FE4E4A /* M13ProgressViewImage.m in Sources */,
FB2A7C071B793E6B00FE4E4A /* M13ProgressViewPie.m in Sources */,
FB2A7C091B793E6B00FE4E4A /* M13ProgressViewRing.m in Sources */,
FB2A7C0B1B793E6B00FE4E4A /* M13ProgressViewSegmentedBar.m in Sources */,
FB2A7C0D1B793E6B00FE4E4A /* M13ProgressViewSegmentedRing.m in Sources */,
FB2A7C0F1B793E6B00FE4E4A /* M13ProgressViewStripedBar.m in Sources */,
FB2A7C111B793E6B00FE4E4A /* M13ProgressViewMetro.m in Sources */,
FB2A7C131B793E6B00FE4E4A /* M13ProgressViewMetroDotPolygon.m in Sources */,
FB2A7C151B793E6B00FE4E4A /* M13ProgressViewRadiative.m in Sources */,
FB2A7C171B793E6B00FE4E4A /* M13ProgressViewLetterpress.m in Sources */,
FB2A7C191B793E6B00FE4E4A /* UIImage+ImageEffects.m in Sources */,
FB2A7C1B1B793E6B00FE4E4A /* M13ProgressHUD.m in Sources */,
FB2A7C1D1B793E6B00FE4E4A /* M13ProgressConsole.m in Sources */,
FB2A7C1F1B793E6B00FE4E4A /* UINavigationController+M13ProgressViewBar.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
CA2FAFC21889907300BCAEF5 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = CA2FAF971889907300BCAEF5 /* M13ProgressSuite */;
target = CA2FAF971889907300BCAEF5 /* M13ProgressSuiteDemo */;
targetProxy = CA2FAFC11889907300BCAEF5 /* PBXContainerItemProxy */;
};
FB2A7BF21B793E5600FE4E4A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = FB2A7BDB1B793E5600FE4E4A /* M13ProgressSuiteFramework */;
targetProxy = FB2A7BF11B793E5600FE4E4A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@@ -740,6 +898,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
@@ -754,7 +913,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -787,7 +946,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
@@ -802,6 +961,8 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "M13ProgressSuite/M13ProgressSuite-Prefix.pch";
INFOPLIST_FILE = "M13ProgressSuite/M13ProgressSuite-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -815,6 +976,8 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "M13ProgressSuite/M13ProgressSuite-Prefix.pch";
INFOPLIST_FILE = "M13ProgressSuite/M13ProgressSuite-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -836,6 +999,7 @@
"$(inherited)",
);
INFOPLIST_FILE = "M13ProgressSuiteTests/M13ProgressSuiteTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
@@ -854,6 +1018,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "M13ProgressSuite/M13ProgressSuite-Prefix.pch";
INFOPLIST_FILE = "M13ProgressSuiteTests/M13ProgressSuiteTests-Info.plist";
PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.${PRODUCT_NAME:rfc1034identifier}";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
@@ -874,6 +1039,67 @@
};
name = Release;
};
FB2A7BF51B793E5600FE4E4A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = M13ProgressSuiteFramework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = M13ProgressSuite;
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
FB2A7BF61B793E5600FE4E4A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
INFOPLIST_FILE = M13ProgressSuiteFramework/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = M13ProgressSuite;
SKIP_INSTALL = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -886,7 +1112,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
CA2FAFCD1889907300BCAEF5 /* Build configuration list for PBXNativeTarget "M13ProgressSuite" */ = {
CA2FAFCD1889907300BCAEF5 /* Build configuration list for PBXNativeTarget "M13ProgressSuiteDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
CA2FAFCE1889907300BCAEF5 /* Debug */,
@@ -913,6 +1139,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FB2A7BF91B793E5600FE4E4A /* Build configuration list for PBXNativeTarget "M13ProgressSuiteFramework" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FB2A7BF51B793E5600FE4E4A /* Debug */,
FB2A7BF61B793E5600FE4E4A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = CA2FAF901889907300BCAEF5 /* Project object */;
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:M13ProgressSuite.xcodeproj">
</FileRef>
</Workspace>
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>7507E241-7356-49FB-9DC2-DBFCB588EA4D</string>
<key>IDESourceControlProjectName</key>
<string>M13ProgressSuite</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>80E955AD-59AA-4DA6-BFAA-1DAA897327A2</key>
<string>https://github.com/Marxon13/M13ProgressSuite.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>M13ProgressSuite.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>80E955AD-59AA-4DA6-BFAA-1DAA897327A2</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/Marxon13/M13ProgressSuite.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>80E955AD-59AA-4DA6-BFAA-1DAA897327A2</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>80E955AD-59AA-4DA6-BFAA-1DAA897327A2</string>
<key>IDESourceControlWCCName</key>
<string>M13ProgressSuite</string>
</dict>
</array>
</dict>
</plist>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
LastUpgradeVersion = "0720"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -14,40 +14,61 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA2FB0431889986D00BCAEF5"
BuildableName = "Documentation"
BlueprintName = "Documentation"
BlueprintIdentifier = "FB2A7BDB1B793E5600FE4E4A"
BuildableName = "M13ProgressSuite.framework"
BlueprintName = "M13ProgressSuiteFramework"
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB2A7BDB1B793E5600FE4E4A"
BuildableName = "M13ProgressSuite.framework"
BlueprintName = "M13ProgressSuiteFramework"
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FB2A7BDB1B793E5600FE4E4A"
BuildableName = "M13ProgressSuite.framework"
BlueprintName = "M13ProgressSuiteFramework"
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA2FAF971889907300BCAEF5"
BuildableName = "M13ProgressSuite.app"
BlueprintName = "M13ProgressSuite"
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA2FAFBB1889907300BCAEF5"
BuildableName = "M13ProgressSuiteTests.xctest"
BlueprintName = "M13ProgressSuiteTests"
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA2FAF971889907300BCAEF5"
BuildableName = "M13ProgressSuite.app"
BlueprintName = "M13ProgressSuite"
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA2FAF971889907300BCAEF5"
BuildableName = "M13ProgressSuite.app"
BlueprintName = "M13ProgressSuite"
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CA2FAF971889907300BCAEF5"
BuildableName = "M13ProgressSuite.app"
BlueprintName = "M13ProgressSuite"
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Documentation.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>M13ProgressSuite.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>CA2FAF971889907300BCAEF5</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>CA2FAFBB1889907300BCAEF5</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>CA2FB03F1889984A00BCAEF5</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>CA2FB0431889986D00BCAEF5</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:M13ProgressSuite.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>813B09B1-82CF-4441-9F57-6D1F9680EEE9</string>
<key>IDESourceControlProjectName</key>
<string>M13ProgressSuite</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>80E955AD-59AA-4DA6-BFAA-1DAA897327A2</key>
<string>https://github.com/Marxon13/M13ProgressSuite.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>M13ProgressSuite.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>80E955AD-59AA-4DA6-BFAA-1DAA897327A2</key>
<string>..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/Marxon13/M13ProgressSuite.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>80E955AD-59AA-4DA6-BFAA-1DAA897327A2</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>80E955AD-59AA-4DA6-BFAA-1DAA897327A2</string>
<key>IDESourceControlWCCName</key>
<string>M13ProgressSuite</string>
</dict>
</array>
</dict>
</plist>
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
<true/>
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
<false/>
</dict>
</plist>
@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
+2
View File
@@ -23,6 +23,7 @@
@property (nonatomic, retain) IBOutlet UIButton *animateButton;
@property (nonatomic, retain) IBOutlet UISegmentedControl *iconControl;
@property (nonatomic, retain) IBOutlet UISwitch *indeterminateSwitch;
@property (nonatomic, retain) IBOutlet UISwitch *cornerRadiusSwitch;
@property (nonatomic, retain) IBOutlet UISwitch *showPercentageSwitch;
@property (nonatomic, retain) IBOutlet UISegmentedControl *positionControl;
@property (nonatomic, retain) IBOutlet UISegmentedControl *directionControl;
@@ -31,6 +32,7 @@
- (IBAction)progressChanged:(id)sender;
- (IBAction)iconChanged:(id)sender;
- (IBAction)indeterminateChanged:(id)sender;
- (IBAction)cornerRadiusChanged:(id)sender;
- (IBAction)showPercentage:(id)sender;
- (IBAction)percentagePositionChangeed:(id)sender;
- (IBAction)directioChanged:(id)sender;
+10
View File
@@ -38,6 +38,10 @@
//Set the percentage position
_progressViewVertical.percentagePosition = M13ProgressViewBarPercentagePositionTop;
_progressViewHorizontal.percentagePosition = M13ProgressViewBarPercentagePositionTop;
// Remove corner radius
_progressViewVertical.progressBarCornerRadius = 0.0;
_progressViewHorizontal.progressBarCornerRadius = 0.0;
}
- (void)didReceiveMemoryWarning
@@ -92,6 +96,12 @@
[_progressViewVertical setIndeterminate:_indeterminateSwitch.on];
}
- (IBAction)cornerRadiusChanged:(id)sender
{
[_progressViewHorizontal setProgressBarCornerRadius:_cornerRadiusSwitch.on ? _progressViewHorizontal.progressBarThickness / 2.0 : 0.0];
[_progressViewVertical setProgressBarCornerRadius:_cornerRadiusSwitch.on ? _progressViewVertical.progressBarThickness / 2.0 : 0.0];
}
- (void)animateProgress:(id)sender
{
//Disable other controls
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

@@ -1,23 +1,59 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon29x29@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon40x40@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon60x60@3x.png",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
@@ -53,6 +89,11 @@
"idiom" : "ipad",
"filename" : "AppIcon76x76@2x.png",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 360 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

+1 -1
View File
@@ -59,7 +59,7 @@
_progressView.pointSpacing = 0.0;
} else {
_progressView.pointShape = M13ProgressViewLetterpressPointShapeSquare;
_progressView.pointSpacing = 2.0;
_progressView.pointSpacing = .15;
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.BrandonMcQuilkin.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -21,6 +21,7 @@
@property (nonatomic, retain) IBOutlet UISwitch *titleSwitch;
@property (nonatomic, retain) IBOutlet UIButton *finishButton;
@property (nonatomic, retain) IBOutlet UIButton *cancelButton;
@property (weak, nonatomic) IBOutlet UISwitch *clearBackgroundSwitch;
- (IBAction)animateProgress:(id)sender;
- (IBAction)progressChanged:(id)sender;
@@ -30,5 +31,7 @@
- (IBAction)secondaryColorChanged:(id)sender;
- (IBAction)finish:(id)sender;
- (IBAction)cancel:(id)sender;
- (IBAction)backgroundColorChanged:(id)sender;
- (IBAction)clearBackgroundChanged:(id)sender;
@end
@@ -33,6 +33,7 @@
{
[self.navigationController showProgress];
[super viewDidLoad];
[self.navigationController setBackgroundColor:[UIColor blackColor]];
// Do any additional setup after loading the view.
}
@@ -109,6 +110,23 @@
[self.navigationController cancelProgress];
}
- (IBAction)backgroundColorChanged:(id)sender
{
CGFloat red = (float)arc4random_uniform(256)/255.0;
CGFloat green = (float)arc4random_uniform(256)/255.0;
CGFloat blue = (float)arc4random_uniform(256)/255.0;
[self.navigationController setBackgroundColor:[UIColor colorWithRed:red green:green blue:blue alpha:1.0]];
}
- (IBAction)clearBackgroundChanged:(id)sender
{
if (_clearBackgroundSwitch.on) {
[self.navigationController setBackgroundColor:nil];
} else {
[self.navigationController setBackgroundColor:[UIColor blackColor]];
}
}
- (void)primaryColorChanged:(id)sender
{
CGFloat red = (float)arc4random_uniform(256)/255.0;
@@ -125,4 +143,6 @@
[self.navigationController setSecondaryColor:[UIColor colorWithRed:red green:green blue:blue alpha:1.0]];
}
@end
+3 -2
View File
@@ -15,6 +15,7 @@
#import "M13ProgressHUD.h"
#import "M13ProgressViewRing.h"
#import "AppDelegate.h"
#import "UIApplication+M13ProgressSuite.h"
@interface ProgressHUDViewController ()
@@ -45,7 +46,7 @@
HUD = [[M13ProgressHUD alloc] initWithProgressView:[[M13ProgressViewRing alloc] init]];
HUD.progressViewSize = CGSizeMake(60.0, 60.0);
HUD.animationPoint = CGPointMake([UIScreen mainScreen].bounds.size.width / 2, [UIScreen mainScreen].bounds.size.height / 2);
UIWindow *window = ((AppDelegate *)[UIApplication sharedApplication].delegate).window;
UIWindow *window = ((AppDelegate *)[UIApplication safeM13SharedApplication].delegate).window;
[window addSubview:HUD];
}
@@ -175,7 +176,7 @@
{
if (_superviewControl.selectedSegmentIndex == 0) {
[HUD removeFromSuperview];
UIWindow *window = ((AppDelegate *)[UIApplication sharedApplication].delegate).window;
UIWindow *window = ((AppDelegate *)[UIApplication safeM13SharedApplication].delegate).window;
[window addSubview:HUD];
} else {
[HUD removeFromSuperview];
@@ -22,6 +22,7 @@
@property (nonatomic, retain) IBOutlet UIButton *animateButton;
@property (nonatomic, retain) IBOutlet UISegmentedControl *iconControl;
@property (nonatomic, retain) IBOutlet UISwitch *indeterminateSwitch;
@property (nonatomic, retain) IBOutlet UISwitch *colorizeSwitch;
@property (nonatomic, retain) IBOutlet UISegmentedControl *directionControl;
@property (nonatomic, retain) IBOutlet UISegmentedControl *shapeControl;
@@ -31,5 +32,6 @@
- (IBAction)indeterminateChanged:(id)sender;
- (IBAction)directioChanged:(id)sender;
- (IBAction)shapeChanged:(id)sender;
- (IBAction)colorizeChanged:(id)sender;
@end
@@ -153,4 +153,53 @@
}
}
- (void)colorizeChanged:(id)sender
{
if (_colorizeSwitch.on) {
NSArray *foregroundColors = @[[UIColor colorWithRed:0.12 green:0.98 blue:0.33 alpha:1],
[UIColor colorWithRed:0.12 green:0.98 blue:0.33 alpha:1],
[UIColor colorWithRed:0.12 green:0.98 blue:0.33 alpha:1],
[UIColor colorWithRed:0.12 green:0.98 blue:0.33 alpha:1],
[UIColor colorWithRed:0.12 green:0.98 blue:0.33 alpha:1],
[UIColor colorWithRed:0.12 green:0.98 blue:0.33 alpha:1],
[UIColor colorWithRed:0.12 green:0.98 blue:0.33 alpha:1],
[UIColor colorWithRed:0.12 green:0.98 blue:0.33 alpha:1],
[UIColor colorWithRed:1 green:0.96 blue:0.32 alpha:1],
[UIColor colorWithRed:1 green:0.96 blue:0.32 alpha:1],
[UIColor colorWithRed:1 green:0.96 blue:0.32 alpha:1],
[UIColor colorWithRed:1 green:0.96 blue:0.32 alpha:1],
[UIColor colorWithRed:1 green:0.12 blue:0.12 alpha:1],
[UIColor colorWithRed:1 green:0.12 blue:0.12 alpha:1],
[UIColor colorWithRed:1 green:0.12 blue:0.12 alpha:1],
[UIColor colorWithRed:1 green:0.12 blue:0.12 alpha:1]];
NSArray *backgroundColors = @[[UIColor colorWithRed:0.07 green:0.44 blue:0.14 alpha:1],
[UIColor colorWithRed:0.07 green:0.44 blue:0.14 alpha:1],
[UIColor colorWithRed:0.07 green:0.44 blue:0.14 alpha:1],
[UIColor colorWithRed:0.07 green:0.44 blue:0.14 alpha:1],
[UIColor colorWithRed:0.07 green:0.44 blue:0.14 alpha:1],
[UIColor colorWithRed:0.07 green:0.44 blue:0.14 alpha:1],
[UIColor colorWithRed:0.07 green:0.44 blue:0.14 alpha:1],
[UIColor colorWithRed:0.07 green:0.44 blue:0.14 alpha:1],
[UIColor colorWithRed:0.82 green:0.79 blue:0.25 alpha:1],
[UIColor colorWithRed:0.82 green:0.79 blue:0.25 alpha:1],
[UIColor colorWithRed:0.82 green:0.79 blue:0.25 alpha:1],
[UIColor colorWithRed:0.82 green:0.79 blue:0.25 alpha:1],
[UIColor colorWithRed:0.69 green:0.07 blue:0.1 alpha:1],
[UIColor colorWithRed:0.69 green:0.07 blue:0.1 alpha:1],
[UIColor colorWithRed:0.69 green:0.07 blue:0.1 alpha:1],
[UIColor colorWithRed:0.69 green:0.07 blue:0.1 alpha:1]];
_progressViewHorizontal.primaryColors = foregroundColors;
_progressViewHorizontal.secondaryColors = backgroundColors;
_progressViewVertical.primaryColors = foregroundColors;
_progressViewVertical.secondaryColors = backgroundColors;
} else {
_progressViewHorizontal.primaryColors = nil;
_progressViewHorizontal.secondaryColors = nil;
_progressViewVertical.primaryColors = nil;
_progressViewVertical.secondaryColors = nil;
}
}
@end
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.2.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
@@ -0,0 +1,35 @@
//
// M13ProgressSuiteFramework.h
// M13ProgressSuiteFramework
//
// Created by Rusty Zarse on 8/10/15.
// Copyright (c) 2015 Brandon McQuilkin. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for M13ProgressSuiteFramework.
FOUNDATION_EXPORT double M13ProgressSuiteFrameworkVersionNumber;
//! Project version string for M13ProgressSuiteFramework.
FOUNDATION_EXPORT const unsigned char M13ProgressSuiteFrameworkVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <M13ProgressSuiteFramework/PublicHeader.h>
#import <M13ProgressSuite/M13ProgressConsole.h>
#import <M13ProgressSuite/M13ProgressHUD.h>
#import <M13ProgressSuite/UIImage+ImageEffects.h>
#import <M13ProgressSuite/UINavigationController+M13ProgressViewBar.h>
#import <M13ProgressSuite/M13ProgressView.h>
#import <M13ProgressSuite/M13ProgressViewBar.h>
#import <M13ProgressSuite/M13ProgressViewBorderedBar.h>
#import <M13ProgressSuite/M13ProgressViewFilteredImage.h>
#import <M13ProgressSuite/M13ProgressViewImage.h>
#import <M13ProgressSuite/M13ProgressViewLetterpress.h>
#import <M13ProgressSuite/M13ProgressViewMetro.h>
#import <M13ProgressSuite/M13ProgressViewMetroDotPolygon.h>
#import <M13ProgressSuite/M13ProgressViewPie.h>
#import <M13ProgressSuite/M13ProgressViewRadiative.h>
#import <M13ProgressSuite/M13ProgressViewRing.h>
#import <M13ProgressSuite/M13ProgressViewSegmentedBar.h>
#import <M13ProgressSuite/M13ProgressViewSegmentedRing.h>
#import <M13ProgressSuite/M13ProgressViewStripedBar.h>
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.BrandonMcQuilkin.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
-1
View File
@@ -1 +0,0 @@
platform :ios, '7.0'
-1
View File
@@ -1 +0,0 @@
COCOAPODS: 0.29.0
-1
View File
@@ -1 +0,0 @@
COCOAPODS: 0.29.0
-153
View File
@@ -1,153 +0,0 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXFileReference section */
4091A373B73C4A27ADAD4769 /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
CA2FB0381889962400BCAEF5 /* M13ProgressSuite.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = M13ProgressSuite.podspec; path = ../M13ProgressSuite.podspec; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
69E5D61CD9424E20B8EA611B /* Targets Support Files */ = {
isa = PBXGroup;
children = (
);
name = "Targets Support Files";
sourceTree = "<group>";
};
A48F45E5E2B742BA90196EC9 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
A6ABBF17EB0F4659B70B42DF = {
isa = PBXGroup;
children = (
4091A373B73C4A27ADAD4769 /* Podfile */,
CA2FB0381889962400BCAEF5 /* M13ProgressSuite.podspec */,
A48F45E5E2B742BA90196EC9 /* Frameworks */,
EC503B258A6543E593AA5D4A /* Products */,
69E5D61CD9424E20B8EA611B /* Targets Support Files */,
);
sourceTree = "<group>";
};
EC503B258A6543E593AA5D4A /* Products */ = {
isa = PBXGroup;
children = (
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXProject section */
E06C8CF63F114B39951D6481 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
};
buildConfigurationList = 6A92FF1B24B94719A11F4550 /* Build configuration list for PBXProject "Pods" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = A6ABBF17EB0F4659B70B42DF;
productRefGroup = EC503B258A6543E593AA5D4A /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
);
};
/* End PBXProject section */
/* Begin XCBuildConfiguration section */
39C892BC1E264603903391F9 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
ONLY_ACTIVE_ARCH = YES;
STRIP_INSTALLED_PRODUCT = NO;
};
name = Debug;
};
625E83DFAD34427AAD480E91 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
COPY_PHASE_STRIP = NO;
ENABLE_NS_ASSERTIONS = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
STRIP_INSTALLED_PRODUCT = NO;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
6A92FF1B24B94719A11F4550 /* Build configuration list for PBXProject "Pods" */ = {
isa = XCConfigurationList;
buildConfigurations = (
39C892BC1E264603903391F9 /* Debug */,
625E83DFAD34427AAD480E91 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = E06C8CF63F114B39951D6481 /* Project object */;
}
+47 -3
View File
@@ -96,9 +96,53 @@ A set of progess view based off of the same superclass. Allowing easy switching
<img src="https://raw.github.com/Marxon13/M13ProgressSuite/master/ReadmeResources/StripedIndeterminate.gif">
Known Bugs:
------------
* When the HUD is set to apply the iOS 7 style blur to the HUD background, it doesn't work. The screenshot of the superview is not taken in the proper CGRect. It seems to work when the mask type is set to iOS 7 Blur, I beleive it is because the CGRectOrigin is {0, 0}.
Progress View Usage:
--------------------
All progress bars follow the same general usage:
```
// Create the progress view.
M13ProgressViewBar *progressView = [[M13ProgressViewBar alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 5.0)];
// Configure the progress view here.
// Add it to the view.
[self.view addSubview: progressView];
// Update the progress as needed
[progressView setProgress: 0.1 animated: YES];
```
HUD Usage:
----------
```
// Create the HUD
M13ProgressHUD *HUD = [[M13ProgressHUD alloc] initWithProgressView:[[M13ProgressViewRing alloc] init]];
// Configure the progress view
HUD.progressViewSize = CGSizeMake(60.0, 60.0);
HUD.animationPoint = CGPointMake([UIScreen mainScreen].bounds.size.width / 2, [UIScreen mainScreen].bounds.size.height / 2);
// Add the HUD to the window. (Or any UIView)
UIWindow *window = ((AppDelegate *)[UIApplication sharedApplication].delegate).window;
[window addSubview:HUD];
// Show the HUD
[HUD show:YES];
//Update the HUD progress
[HUD setProgress:0.5 animated:YES];
// Update the HUD status
HUD.status = @"Processing";
// Hide the HUD
[HUD show:NO];
```
Contact Me:
-------------