Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ab6ece6f29 | |||
| b6a9f52057 | |||
| 0020ab2eae | |||
| 645fcf238e | |||
| c92b4390e2 | |||
| 121ced54a8 | |||
| a0a1074379 | |||
| 5fa55e4125 | |||
| 894e60cfd9 | |||
| 2bcfe6fc5e | |||
| 9d6365c25b | |||
| 5b2371819a | |||
| 7b1a47024c | |||
| 71c237eec6 | |||
| 53a3c25f91 | |||
| 56f020ced6 | |||
| 6000d1de0f |
@@ -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
|
||||
@@ -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??%";
|
||||
}
|
||||
|
||||
@@ -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.*/
|
||||
|
||||
@@ -320,7 +320,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;
|
||||
|
||||
@@ -351,9 +360,22 @@
|
||||
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];
|
||||
@@ -554,19 +576,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 +630,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]);
|
||||
@@ -683,7 +705,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
|
||||
@@ -711,8 +733,8 @@
|
||||
transition.duration = 0.3;
|
||||
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
||||
transition.type = kCATransitionFade;
|
||||
[maskView.layer addAnimation:transition forKey:nil];
|
||||
maskView.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[self->maskView.layer addAnimation:transition forKey:nil];
|
||||
self->maskView.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -731,8 +753,8 @@
|
||||
transition.duration = 0.3;
|
||||
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
||||
transition.type = kCATransitionFade;
|
||||
[backgroundView.layer addAnimation:transition forKey:nil];
|
||||
backgroundView.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
[self->backgroundView.layer addAnimation:transition forKey:nil];
|
||||
self->backgroundView.backgroundColor = [UIColor colorWithPatternImage:image];
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
unsigned int 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);
|
||||
|
||||
@@ -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.
|
||||
@@ -129,6 +130,25 @@ 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
|
||||
@@ -144,7 +164,7 @@ static char secondaryColorKey;
|
||||
|
||||
- (void)updateProgress
|
||||
{
|
||||
[self updateProgressWithInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation];
|
||||
[self updateProgressWithInterfaceOrientation:[self currentDeviceOrientation]];
|
||||
}
|
||||
|
||||
- (void)updateProgressWithInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
@@ -195,7 +215,7 @@ static char secondaryColorKey;
|
||||
//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 {
|
||||
@@ -213,7 +233,7 @@ static char secondaryColorKey;
|
||||
|
||||
- (void)drawIndeterminate
|
||||
{
|
||||
[self drawIndeterminateWithInterfaceOrientation:[UIApplication sharedApplication].statusBarOrientation];
|
||||
[self drawIndeterminateWithInterfaceOrientation:[self currentDeviceOrientation]];
|
||||
}
|
||||
|
||||
- (void)drawIndeterminateWithInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
@@ -230,20 +250,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
|
||||
@@ -348,7 +361,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
|
||||
@@ -359,7 +372,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
|
||||
@@ -370,7 +383,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
|
||||
@@ -386,7 +399,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];
|
||||
|
||||
@@ -229,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 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,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];
|
||||
@@ -373,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]];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -600,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 = @"∞";
|
||||
}
|
||||
|
||||
@@ -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 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];
|
||||
|
||||
});
|
||||
|
||||
@@ -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 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];
|
||||
|
||||
});
|
||||
@@ -186,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];
|
||||
|
||||
@@ -134,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 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];
|
||||
|
||||
});
|
||||
@@ -194,8 +194,8 @@
|
||||
//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));
|
||||
@@ -218,23 +218,23 @@
|
||||
int yTo = height;
|
||||
|
||||
if (_progressDirection == M13ProgressViewImageProgressDirectionBottomToTop) {
|
||||
yTo = height * (1 - self.progress);
|
||||
yTo = height * (int)(1 - self.progress);
|
||||
} else if (_progressDirection == M13ProgressViewImageProgressDirectionTopToBottom) {
|
||||
yFrom = height * self.progress;
|
||||
yFrom = height * (int)self.progress;
|
||||
} else if (_progressDirection == M13ProgressViewImageProgressDirectionLeftToRight) {
|
||||
xFrom = width * self.progress;
|
||||
xFrom = width * (int)self.progress;
|
||||
} else if (_progressDirection == M13ProgressViewImageProgressDirectionRightToLeft) {
|
||||
xTo = width * (1 - self.progress);
|
||||
xTo = width * (int)(1 - self.progress);
|
||||
}
|
||||
|
||||
for (int x = xFrom; x < xTo; x++) {
|
||||
for (int y = yFrom; y < yTo; y++) {
|
||||
//Get the pixel
|
||||
uint8_t *rgbaPixel = (uint8_t *) &pixels[y * width + x];
|
||||
uint32_t *rgbaPixel = (uint32_t *) &pixels[y * width + x];
|
||||
//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];
|
||||
uint32_t gray = (uint32_t)(0.3 * rgbaPixel[RED] + 0.59 * rgbaPixel[GREEN] + 0.11 * rgbaPixel[BLUE]);
|
||||
// set the pixels to gray
|
||||
rgbaPixel[RED] = gray;
|
||||
rgbaPixel[GREEN] = gray;
|
||||
|
||||
@@ -193,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 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];
|
||||
|
||||
});
|
||||
@@ -256,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;
|
||||
|
||||
@@ -261,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 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];
|
||||
|
||||
});
|
||||
@@ -281,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++) {
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -85,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;
|
||||
|
||||
|
||||
@@ -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 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];
|
||||
|
||||
});
|
||||
@@ -244,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) {
|
||||
|
||||
@@ -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 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];
|
||||
|
||||
});
|
||||
@@ -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];
|
||||
|
||||
@@ -204,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 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];
|
||||
|
||||
});
|
||||
@@ -228,7 +228,7 @@
|
||||
[self setNeedsDisplay];
|
||||
[CATransaction begin];
|
||||
for (int i = 0; i < _numberOfSegments; i++) {
|
||||
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
|
||||
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
|
||||
CABasicAnimation *barAnimation = [self barColorAnimation];
|
||||
barAnimation.fromValue = (id)layer.fillColor;
|
||||
barAnimation.toValue = (id)[self colorForSegment:i].CGColor;
|
||||
@@ -240,7 +240,7 @@
|
||||
[self setNeedsDisplay];
|
||||
[CATransaction begin];
|
||||
for (int i = 0; i < _numberOfSegments; i++) {
|
||||
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
|
||||
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
|
||||
CABasicAnimation *barAnimation = [self barColorAnimation];
|
||||
barAnimation.fromValue = (id)layer.fillColor;
|
||||
barAnimation.toValue = (id)_successColor.CGColor;
|
||||
@@ -252,7 +252,7 @@
|
||||
[self setNeedsDisplay];
|
||||
[CATransaction begin];
|
||||
for (int i = 0; i < _numberOfSegments; i++) {
|
||||
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
|
||||
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
|
||||
CABasicAnimation *barAnimation = [self barColorAnimation];
|
||||
barAnimation.fromValue = (id)layer.fillColor;
|
||||
barAnimation.toValue = (id)_failureColor.CGColor;
|
||||
@@ -359,7 +359,7 @@
|
||||
|
||||
- (NSInteger)numberOfFullSegments
|
||||
{
|
||||
return (NSInteger)floorf(self.progress * _numberOfSegments);
|
||||
return (NSInteger)floorf((float)self.progress * (float)_numberOfSegments);
|
||||
}
|
||||
|
||||
- (UIColor *)colorForSegment:(NSUInteger)index
|
||||
@@ -393,7 +393,7 @@
|
||||
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);
|
||||
}
|
||||
|
||||
//Iterate through all the segments that are full.
|
||||
@@ -450,7 +450,7 @@
|
||||
}
|
||||
|
||||
//Add segment to the proper layer, and color it
|
||||
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
|
||||
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
|
||||
layer.path = path.CGPath;
|
||||
layer.fillColor = [self colorForSegment:i].CGColor;
|
||||
}
|
||||
@@ -470,7 +470,7 @@
|
||||
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);
|
||||
}
|
||||
//What index will the segments be colored from.
|
||||
NSInteger numberOfSegmentsToBeColored = _numberOfSegments / 4;
|
||||
@@ -529,7 +529,7 @@
|
||||
}
|
||||
|
||||
//Add the segment to the proper path //Add segment to the proper layer, and color it
|
||||
CAShapeLayer *layer = _segmentsLayer.sublayers[i];
|
||||
CAShapeLayer *layer = (CAShapeLayer *)_segmentsLayer.sublayers[i];
|
||||
layer.path = path.CGPath;
|
||||
if (i >= indeterminateIndex && i < indeterminateIndex + numberOfSegmentsToBeColored) {
|
||||
layer.fillColor = ((UIColor *)segmentColorsPrimary[i]).CGColor;
|
||||
|
||||
@@ -89,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;
|
||||
@@ -233,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 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];
|
||||
|
||||
});
|
||||
@@ -274,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];
|
||||
}
|
||||
@@ -294,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];
|
||||
}
|
||||
@@ -333,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];
|
||||
}];
|
||||
|
||||
@@ -235,18 +235,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 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];
|
||||
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = "M13ProgressSuite"
|
||||
s.version = "1.2.7"
|
||||
s.version = "1.2.8"
|
||||
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.7"}
|
||||
s.source = { :git => "https://github.com/Marxon13/M13ProgressSuite.git", :tag => "v1.2.8"}
|
||||
|
||||
s.source_files = 'Classes/*/*'
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
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 */; };
|
||||
@@ -56,9 +57,9 @@
|
||||
CA412B0518D2638E00FCB7CC /* RadiativeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA412B0418D2638E00FCB7CC /* RadiativeViewController.m */; };
|
||||
CA66890618CBEF9300827C48 /* MetroViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA66890518CBEF9300827C48 /* MetroViewController.m */; };
|
||||
CA6F31C7190EBF11008D1E64 /* LetterpressViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = CA6F31C6190EBF11008D1E64 /* LetterpressViewController.m */; };
|
||||
FB2A7BE11B793E5600FE4E4A /* M13ProgressSuiteFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = FB2A7BE01B793E5600FE4E4A /* M13ProgressSuiteFramework.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
FB2A7BF31B793E5600FE4E4A /* M13ProgressSuiteFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuiteFramework.framework */; };
|
||||
FB2A7BF41B793E5600FE4E4A /* M13ProgressSuiteFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuiteFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
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, ); }; };
|
||||
@@ -121,7 +122,7 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
FB2A7BF41B793E5600FE4E4A /* M13ProgressSuiteFramework.framework in Embed Frameworks */,
|
||||
FB2A7BF41B793E5600FE4E4A /* M13ProgressSuite.framework in Embed Frameworks */,
|
||||
);
|
||||
name = "Embed Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -129,6 +130,8 @@
|
||||
/* 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; };
|
||||
@@ -220,9 +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 /* M13ProgressSuiteFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = M13ProgressSuiteFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
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 /* M13ProgressSuiteFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = M13ProgressSuiteFramework.h; sourceTree = "<group>"; };
|
||||
FB2A7BE01B793E5600FE4E4A /* M13ProgressSuite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = M13ProgressSuite.h; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -231,7 +234,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CA2FAF9E1889907300BCAEF5 /* CoreGraphics.framework in Frameworks */,
|
||||
FB2A7BF31B793E5600FE4E4A /* M13ProgressSuiteFramework.framework in Frameworks */,
|
||||
FB2A7BF31B793E5600FE4E4A /* M13ProgressSuite.framework in Frameworks */,
|
||||
CA2FB03E1889975A00BCAEF5 /* QuartzCore.framework in Frameworks */,
|
||||
CA2FB03C1889975400BCAEF5 /* CoreImage.framework in Frameworks */,
|
||||
CA2FB03A1889974600BCAEF5 /* Accelerate.framework in Frameworks */,
|
||||
@@ -260,6 +263,15 @@
|
||||
/* 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 = (
|
||||
@@ -278,7 +290,7 @@
|
||||
children = (
|
||||
CA2FAF981889907300BCAEF5 /* M13ProgressSuite.app */,
|
||||
CA2FAFBC1889907300BCAEF5 /* M13ProgressSuiteTests.xctest */,
|
||||
FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuiteFramework.framework */,
|
||||
FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuite.framework */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@@ -347,6 +359,7 @@
|
||||
CA2FAFDF1889935700BCAEF5 /* HUD */,
|
||||
CA2FAFDB1889934300BCAEF5 /* Console */,
|
||||
CA2FAFD41889928200BCAEF5 /* M13ProgressNavigationController */,
|
||||
62BB85FE1C872FF50019306A /* M13ProgressApplication */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
@@ -570,7 +583,7 @@
|
||||
FB2A7BDD1B793E5600FE4E4A /* M13ProgressSuiteFramework */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
FB2A7BE01B793E5600FE4E4A /* M13ProgressSuiteFramework.h */,
|
||||
FB2A7BE01B793E5600FE4E4A /* M13ProgressSuite.h */,
|
||||
FB2A7BDE1B793E5600FE4E4A /* Supporting Files */,
|
||||
);
|
||||
path = M13ProgressSuiteFramework;
|
||||
@@ -591,7 +604,7 @@
|
||||
isa = PBXHeadersBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
FB2A7BE11B793E5600FE4E4A /* M13ProgressSuiteFramework.h in Headers */,
|
||||
FB2A7BE11B793E5600FE4E4A /* M13ProgressSuite.h in Headers */,
|
||||
FB2A7BFC1B793E6B00FE4E4A /* M13ProgressView.h in Headers */,
|
||||
FB2A7BFE1B793E6B00FE4E4A /* M13ProgressViewBar.h in Headers */,
|
||||
FB2A7C001B793E6B00FE4E4A /* M13ProgressViewBorderedBar.h in Headers */,
|
||||
@@ -668,7 +681,7 @@
|
||||
);
|
||||
name = M13ProgressSuiteFramework;
|
||||
productName = M13ProgressSuiteFramework;
|
||||
productReference = FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuiteFramework.framework */;
|
||||
productReference = FB2A7BDC1B793E5600FE4E4A /* M13ProgressSuite.framework */;
|
||||
productType = "com.apple.product-type.framework";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
@@ -677,7 +690,7 @@
|
||||
CA2FAF901889907300BCAEF5 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0510;
|
||||
LastUpgradeCheck = 0720;
|
||||
ORGANIZATIONNAME = "Brandon McQuilkin";
|
||||
TargetAttributes = {
|
||||
CA2FAFBB1889907300BCAEF5 = {
|
||||
@@ -761,6 +774,7 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
62BB86011C87300F0019306A /* UIApplication+M13ProgressSuite.m in Sources */,
|
||||
CA2FB02B1889946F00BCAEF5 /* SampleViewController.m in Sources */,
|
||||
CA6F31C7190EBF11008D1E64 /* LetterpressViewController.m in Sources */,
|
||||
CA2FB0221889946F00BCAEF5 /* BarViewController.m in Sources */,
|
||||
@@ -884,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;
|
||||
@@ -898,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";
|
||||
@@ -931,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;
|
||||
@@ -947,6 +962,7 @@
|
||||
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;
|
||||
};
|
||||
@@ -961,6 +977,7 @@
|
||||
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;
|
||||
};
|
||||
@@ -982,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;
|
||||
@@ -1000,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;
|
||||
@@ -1023,6 +1042,8 @@
|
||||
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";
|
||||
@@ -1039,10 +1060,11 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = M13ProgressSuiteFramework/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = M13ProgressSuite;
|
||||
SKIP_INSTALL = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -1052,6 +1074,8 @@
|
||||
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;
|
||||
@@ -1065,10 +1089,11 @@
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
INFOPLIST_FILE = M13ProgressSuiteFramework/Info.plist;
|
||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.BrandonMcQuilkin.$(PRODUCT_NAME:rfc1034identifier)";
|
||||
PRODUCT_NAME = M13ProgressSuite;
|
||||
SKIP_INSTALL = YES;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
VERSION_INFO_PREFIX = "";
|
||||
@@ -1121,6 +1146,7 @@
|
||||
FB2A7BF61B793E5600FE4E4A /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
|
||||
+11
-8
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0640"
|
||||
LastUpgradeVersion = "0720"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
@@ -15,7 +15,7 @@
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FB2A7BDB1B793E5600FE4E4A"
|
||||
BuildableName = "M13ProgressSuiteFramework.framework"
|
||||
BuildableName = "M13ProgressSuite.framework"
|
||||
BlueprintName = "M13ProgressSuiteFramework"
|
||||
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
|
||||
</BuildableReference>
|
||||
@@ -23,27 +23,30 @@
|
||||
</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 = "M13ProgressSuiteFramework.framework"
|
||||
BuildableName = "M13ProgressSuite.framework"
|
||||
BlueprintName = "M13ProgressSuiteFramework"
|
||||
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
|
||||
</BuildableReference>
|
||||
@@ -52,16 +55,16 @@
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
buildConfiguration = "Release"
|
||||
debugDocumentVersioning = "YES">
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "FB2A7BDB1B793E5600FE4E4A"
|
||||
BuildableName = "M13ProgressSuiteFramework.framework"
|
||||
BuildableName = "M13ProgressSuite.framework"
|
||||
BlueprintName = "M13ProgressSuiteFramework"
|
||||
ReferencedContainer = "container:M13ProgressSuite.xcodeproj">
|
||||
</BuildableReference>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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>CFBundleName</key>
|
||||
@@ -15,7 +15,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>1.2.8</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
|
||||
@@ -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>
|
||||
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// 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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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:
|
||||
-------------
|
||||
|
||||
Reference in New Issue
Block a user