diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..4d9fee1 --- /dev/null +++ b/Podfile @@ -0,0 +1 @@ +pod 'KAProgressLabel' \ No newline at end of file diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..f83935e --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,10 @@ +PODS: + - KAProgressLabel (3.2) + +DEPENDENCIES: + - KAProgressLabel + +SPEC CHECKSUMS: + KAProgressLabel: 4362a1d37c5a7bc7c10cd059fd2da7cb9599cb50 + +COCOAPODS: 0.38.2 diff --git a/Pods/Headers/Private/KAProgressLabel/KAProgressLabel.h b/Pods/Headers/Private/KAProgressLabel/KAProgressLabel.h new file mode 120000 index 0000000..169b785 --- /dev/null +++ b/Pods/Headers/Private/KAProgressLabel/KAProgressLabel.h @@ -0,0 +1 @@ +../../../KAProgressLabel/KAProgressLabel/KAProgressLabel.h \ No newline at end of file diff --git a/Pods/Headers/Private/KAProgressLabel/TPPropertyAnimation.h b/Pods/Headers/Private/KAProgressLabel/TPPropertyAnimation.h new file mode 120000 index 0000000..dc3c590 --- /dev/null +++ b/Pods/Headers/Private/KAProgressLabel/TPPropertyAnimation.h @@ -0,0 +1 @@ +../../../KAProgressLabel/KAProgressLabel/TPPropertyAnimation.h \ No newline at end of file diff --git a/Pods/Headers/Public/KAProgressLabel/KAProgressLabel.h b/Pods/Headers/Public/KAProgressLabel/KAProgressLabel.h new file mode 120000 index 0000000..169b785 --- /dev/null +++ b/Pods/Headers/Public/KAProgressLabel/KAProgressLabel.h @@ -0,0 +1 @@ +../../../KAProgressLabel/KAProgressLabel/KAProgressLabel.h \ No newline at end of file diff --git a/Pods/Headers/Public/KAProgressLabel/TPPropertyAnimation.h b/Pods/Headers/Public/KAProgressLabel/TPPropertyAnimation.h new file mode 120000 index 0000000..dc3c590 --- /dev/null +++ b/Pods/Headers/Public/KAProgressLabel/TPPropertyAnimation.h @@ -0,0 +1 @@ +../../../KAProgressLabel/KAProgressLabel/TPPropertyAnimation.h \ No newline at end of file diff --git a/Pods/KAProgressLabel/KAProgressLabel/KAProgressLabel.h b/Pods/KAProgressLabel/KAProgressLabel/KAProgressLabel.h new file mode 100644 index 0000000..1c274a1 --- /dev/null +++ b/Pods/KAProgressLabel/KAProgressLabel/KAProgressLabel.h @@ -0,0 +1,58 @@ +// +// KAProgressLabel.h +// KAProgressLabel +// +// Created by Alex on 09/06/13. +// Copyright (c) 2013 Alexis Creuzot. All rights reserved. +// + +#import "TPPropertyAnimation.h" + +@class KAProgressLabel; +typedef void(^labelValueChangedCompletion)(KAProgressLabel *label); + + +@interface KAProgressLabel : UILabel + +@property (nonatomic, copy) labelValueChangedCompletion labelVCBlock; + +// Style +@property (nonatomic) CGFloat trackWidth; +@property (nonatomic) CGFloat progressWidth; +@property (nonatomic) CGFloat roundedCornersWidth; +@property (nonatomic, copy) UIColor * fillColor; +@property (nonatomic, copy) UIColor * trackColor; +@property (nonatomic, copy) UIColor * progressColor; +@property (nonatomic, strong) UILabel * startLabel; +@property (nonatomic, strong) UILabel * endLabel; + +// Logic +@property (nonatomic) CGFloat startDegree; +@property (nonatomic) CGFloat endDegree; +@property (nonatomic) CGFloat progress; + +// Interactivity +@property (nonatomic) BOOL isStartDegreeUserInteractive; +@property (nonatomic) BOOL isEndDegreeUserInteractive; + +// Getters +- (float)radius; + +// Animations +- (void)setStartDegree:(CGFloat)startDegree + timing:(TPPropertyAnimationTiming)timing + duration:(CGFloat)duration + delay:(CGFloat)delay; + +- (void)setEndDegree:(CGFloat)endDegree + timing:(TPPropertyAnimationTiming)timing + duration:(CGFloat)duration + delay:(CGFloat)delay; + +- (void)setProgress:(CGFloat)progress + timing:(TPPropertyAnimationTiming)timing + duration:(CGFloat)duration + delay:(CGFloat)delay; + +- (void)stopAnimations; +@end diff --git a/Pods/KAProgressLabel/KAProgressLabel/KAProgressLabel.m b/Pods/KAProgressLabel/KAProgressLabel/KAProgressLabel.m new file mode 100644 index 0000000..aa88aec --- /dev/null +++ b/Pods/KAProgressLabel/KAProgressLabel/KAProgressLabel.m @@ -0,0 +1,370 @@ +// +// KAProgressLabel.m +// KAProgressLabel +// +// Created by Alex on 09/06/13. +// Copyright (c) 2013 Alexis Creuzot. All rights reserved. +// + +#import +#import "KAProgressLabel.h" + +#define KADegreesToRadians(degrees) ((degrees)/180.0*M_PI) +#define KARadiansToDegrees(radians) ((radians)*180.0/M_PI) + +@implementation KAProgressLabel { + __unsafe_unretained TPPropertyAnimation *_currentAnimation; +} + +@synthesize startDegree = _startDegree; +@synthesize endDegree = _endDegree; +@synthesize progress = _progress; + +#pragma mark Core + +-(void)dealloc +{ + // KVO + [self removeObserver:self forKeyPath:@"trackWidth"]; + [self removeObserver:self forKeyPath:@"progressWidth"]; + [self removeObserver:self forKeyPath:@"fillColor"]; + [self removeObserver:self forKeyPath:@"trackColor"]; + [self removeObserver:self forKeyPath:@"progressColor"]; + [self removeObserver:self forKeyPath:@"startDegree"]; + [self removeObserver:self forKeyPath:@"endDegree"]; + [self removeObserver:self forKeyPath:@"roundedCornersWidth"]; + + [self.startLabel removeObserver:self forKeyPath:@"text"]; + [self.endLabel removeObserver:self forKeyPath:@"text"]; +} + +-(id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + [self baseInit]; + } + return self; +} + +-(id)initWithCoder:(NSCoder *)aDecoder +{ + self = [super initWithCoder:aDecoder]; + if(self) { + [self baseInit]; + } + return self; +} + +-(void)baseInit +{ + // We need a square view + // For now, we resize and center the view + if(self.frame.size.width != self.frame.size.height){ + CGRect frame = self.frame; + float delta = ABS(self.frame.size.width-self.frame.size.height)/2; + if(self.frame.size.width > self.frame.size.height){ + frame.origin.x += delta; + frame.size.width = self.frame.size.height; + self.frame = frame; + }else{ + frame.origin.y += delta; + frame.size.height = self.frame.size.width; + self.frame = frame; + } + } + [self setUserInteractionEnabled:YES]; + + // Style + self.textAlignment = NSTextAlignmentCenter; + self.trackWidth = 5.0; + self.progressWidth = 5.0; + self.roundedCornersWidth = 0.0; + self.fillColor = [UIColor clearColor]; + self.trackColor = [UIColor lightGrayColor]; + self.progressColor = [UIColor blackColor]; + + self.startLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + self.startLabel.textAlignment = NSTextAlignmentCenter; + self.startLabel.adjustsFontSizeToFitWidth = YES; + self.startLabel.minimumScaleFactor = .1; + self.startLabel.clipsToBounds = YES; + + self.endLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + self.endLabel.textAlignment = NSTextAlignmentCenter; + self.endLabel.adjustsFontSizeToFitWidth = YES; + self.endLabel.minimumScaleFactor = .1; + self.endLabel.clipsToBounds = YES; + + [self addSubview:self.startLabel]; + [self addSubview:self.endLabel]; + + // Logic + self.startDegree = 0; + self.endDegree = 0; + self.progress = 0; + + // KVO + [self addObserver:self forKeyPath:@"trackWidth" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"progressWidth" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"fillColor" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"trackColor" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"progressColor" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"startDegree" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"endDegree" options:NSKeyValueObservingOptionNew context:nil]; + [self addObserver:self forKeyPath:@"roundedCornersWidth" options:NSKeyValueObservingOptionNew context:nil]; + + [self.startLabel addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionNew context:nil]; + [self.endLabel addObserver:self forKeyPath:@"text" options:NSKeyValueObservingOptionNew context:nil]; +} + +-(void)drawRect:(CGRect)rect +{ + [self drawProgressLabelCircleInRect:rect]; + [super drawTextInRect:rect]; +} + +#pragma mark - KVO + +- (void)observeValueForKeyPath:(NSString *)keyPath + ofObject:(id)object + change:(NSDictionary *)change + context:(void *)context +{ + [self setNeedsDisplay] ; + + if([keyPath isEqualToString:@"startDegree"] || + [keyPath isEqualToString:@"endDegree"]){ + + KAProgressLabel *__unsafe_unretained weakSelf = self; + if(self.labelVCBlock) { + self.labelVCBlock(weakSelf); + } + } +} + +#pragma mark - Getters + +- (float) radius +{ + return MIN(self.frame.size.width,self.frame.size.height)/2; +} + +- (CGFloat)startDegree +{ + return _startDegree +90; +} + +- (CGFloat)endDegree +{ + return _endDegree +90; +} + +- (CGFloat)progress +{ + return self.endDegree/360; +} + +#pragma mark - Setters + +-(void)setStartDegree:(CGFloat)startDegree +{ + _startDegree = startDegree - 90; +} + +-(void)setEndDegree:(CGFloat)endDegree +{ + _endDegree = endDegree - 90; +} + +-(void)setProgress:(CGFloat)progress +{ + if(self.startDegree != 0){ + [self setStartDegree:0]; + } + [self setEndDegree:progress*360]; +} + +#pragma mark - Animations + +-(void)setStartDegree:(CGFloat)startDegree timing:(TPPropertyAnimationTiming)timing duration:(CGFloat)duration delay:(CGFloat)delay +{ + TPPropertyAnimation *animation = [TPPropertyAnimation propertyAnimationWithKeyPath:@"startDegree"]; + animation.fromValue = @(_startDegree+90); + animation.toValue = @(startDegree); + animation.duration = duration; + animation.startDelay = delay; + animation.timing = timing; + [animation beginWithTarget:self]; + + _currentAnimation = animation; +} + +-(void)setEndDegree:(CGFloat)endDegree timing:(TPPropertyAnimationTiming)timing duration:(CGFloat)duration delay:(CGFloat)delay +{ + TPPropertyAnimation *animation = [TPPropertyAnimation propertyAnimationWithKeyPath:@"endDegree"]; + animation.fromValue = @(_endDegree+90); + animation.toValue = @(endDegree); + animation.duration = duration; + animation.startDelay = delay; + animation.timing = timing; + [animation beginWithTarget:self]; + + _currentAnimation = animation; +} + +-(void)setProgress:(CGFloat)progress timing:(TPPropertyAnimationTiming)timing duration:(CGFloat)duration delay:(CGFloat)delay +{ + [self setEndDegree:(progress*360) timing:timing duration:duration delay:delay]; +} + +- (void) stopAnimations +{ + if (_currentAnimation != nil) { + [_currentAnimation cancel]; + } +} + +#pragma mark - Touch Interaction + +// Limit touch to actual disc surface +- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event +{ + UIBezierPath *p = [UIBezierPath bezierPathWithOvalInRect:self.bounds]; + return ([p containsPoint:point])? self : nil; +} + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesBegan:touches withEvent:event]; + [self moveBasedOnTouches:touches withEvent:event]; +} + +- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesMoved:touches withEvent:event]; + [self moveBasedOnTouches:touches withEvent:event]; +} + +- (void)moveBasedOnTouches:(NSSet *)touches withEvent:(UIEvent *)event +{ + // No interaction enabled + if(!self.isStartDegreeUserInteractive && + !self.isEndDegreeUserInteractive){ + return; + } + + UITouch * touch = [touches anyObject]; + CGPoint touchLocation = [touch locationInView:self]; + + // Coordinates to polar + float x = touchLocation.x - self.frame.size.width/2; + float y = touchLocation.y - self.frame.size.height/2; + int angle = KARadiansToDegrees(atan(y/x)); + angle += (x>=0)? 90 : 270; + + // Interact + if(!self.isStartDegreeUserInteractive) // Only End + { + [self setEndDegree:angle]; + } + else if(!self.isEndDegreeUserInteractive) // Only Start + { + [self setStartDegree:angle]; + } + else // All,hence move nearest knob + { + float startDelta = sqrt(pow(self.startLabel.center.x-touchLocation.x,2) + pow(self.startLabel.center.y- touchLocation.y,2)); + float endDelta = sqrt(pow(self.endLabel.center.x-touchLocation.x,2) + pow(self.endLabel.center.y - touchLocation.y,2)); + if(startDelta 0){ + CGContextSetFillColorWithColor(context, self.progressColor.CGColor); + CGContextAddEllipseInRect(context, [self rectForDegree:_startDegree andRect:rect]); + CGContextAddEllipseInRect(context, [self rectForDegree:_endDegree andRect:rect]); + CGContextFillPath(context); + } + + self.startLabel.frame = [self rectForDegree:_startDegree andRect:rect]; + self.endLabel.frame = [self rectForDegree:_endDegree andRect:rect]; + self.startLabel.layer.cornerRadius = [self borderDelta]; + self.endLabel.layer.cornerRadius = [self borderDelta]; +} + +#pragma mark - Helpers + +- (CGRect) rectForDegree:(float) degree andRect:(CGRect) rect +{ + float x = [self xPosRoundForAngle:degree andRect:rect] - _roundedCornersWidth/2; + float y = [self yPosRoundForAngle:degree andRect:rect] - _roundedCornersWidth/2; + return CGRectMake(x, y, _roundedCornersWidth, _roundedCornersWidth); +} + +- (float) xPosRoundForAngle:(float) degree andRect:(CGRect) rect +{ + return cosf(KADegreesToRadians(degree))* [self radius] + - cosf(KADegreesToRadians(degree)) * [self borderDelta] + + rect.size.width/2; +} + +- (float) yPosRoundForAngle:(float) degree andRect:(CGRect) rect +{ + return sinf(KADegreesToRadians(degree))* [self radius] + - sinf(KADegreesToRadians(degree)) * [self borderDelta] + + rect.size.height/2; +} + +- (float) borderDelta +{ + return MAX(MAX(_trackWidth,_progressWidth),_roundedCornersWidth)/2; +} + +-(CGRect)rectForCircle:(CGRect)rect +{ + CGFloat minDim = MIN(self.bounds.size.width, self.bounds.size.height); + CGFloat circleRadius = (minDim / 2) - [self borderDelta]; + CGPoint circleCenter = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect)); + return CGRectMake(circleCenter.x - circleRadius, circleCenter.y - circleRadius, 2 * circleRadius, 2 * circleRadius); +} + +@end diff --git a/Pods/KAProgressLabel/KAProgressLabel/TPPropertyAnimation.h b/Pods/KAProgressLabel/KAProgressLabel/TPPropertyAnimation.h new file mode 100644 index 0000000..f3b5e94 --- /dev/null +++ b/Pods/KAProgressLabel/KAProgressLabel/TPPropertyAnimation.h @@ -0,0 +1,95 @@ +// +// TPPropertyAnimation.h +// Property Animation http://atastypixel.com/blog/key-path-based-property-animation +// +// Created by Michael Tyson on 13/08/2010. +// Copyright 2010 A Tasty Pixel. All rights reserved. +// +// Licensed under the terms of the BSD License, as specified below. +// + +/* + Copyright (c) 2010, Michael Tyson + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of A Tasty Pixel nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import + +// Animation timing types +typedef enum { + TPPropertyAnimationTimingLinear, + TPPropertyAnimationTimingEaseIn, + TPPropertyAnimationTimingEaseOut, + TPPropertyAnimationTimingEaseInEaseOut +} TPPropertyAnimationTiming; + +@interface TPPropertyAnimation : NSObject { + NSString *keyPath; + id target; + id delegate; + CGFloat duration; + CGFloat startDelay; + TPPropertyAnimationTiming timing; + TPPropertyAnimation *chainedAnimation; + id fromValue; + id toValue; + + @private + NSTimeInterval startTime; +} + +// Create a new animation ++ (TPPropertyAnimation*)propertyAnimationWithKeyPath:(NSString*)keyPath; + +// Get all animations for the given target object (if there are no animations, will return an empty array) +// You can then cancel all animations for a target by calling [[TPPropertyAnimation allPropertyAnimationsForTarget:object] makeObjectsPerformSelector:@selector(cancel)] ++ (NSArray*)allPropertyAnimationsForTarget:(id)target; + +// Start the animation +- (void)beginWithTarget:(id)target; + +// Cancel the animation +- (void)cancel; + +@property (nonatomic, retain) id delegate; +@property (nonatomic, retain) id target; +@property (nonatomic, readonly) NSString *keyPath; +@property (nonatomic, assign) CGFloat duration; +@property (nonatomic, assign) CGFloat startDelay; +@property (nonatomic, retain) id fromValue; +@property (nonatomic, retain) id toValue; +@property (nonatomic, assign) TPPropertyAnimationTiming timing; +@property (nonatomic, retain) TPPropertyAnimation *chainedAnimation; +@end + +// Implement this to act as a delegate +@interface NSObject (TPPropertyAnimationDelegate) +- (void)propertyAnimationDidFinish:(TPPropertyAnimation*)propertyAnimation; +@end \ No newline at end of file diff --git a/Pods/KAProgressLabel/KAProgressLabel/TPPropertyAnimation.m b/Pods/KAProgressLabel/KAProgressLabel/TPPropertyAnimation.m new file mode 100644 index 0000000..e540e30 --- /dev/null +++ b/Pods/KAProgressLabel/KAProgressLabel/TPPropertyAnimation.m @@ -0,0 +1,207 @@ +// +// TPPropertyAnimation.m +// Property Animation http://atastypixel.com/blog/key-path-based-property-animation +// +// Created by Michael Tyson on 13/08/2010. +// Copyright 2010 A Tasty Pixel. All rights reserved. +// + +#import "TPPropertyAnimation.h" +#import + +#define kRefreshRate 1.0/30.0 + +// Storage for singleton manager +@class TPPropertyAnimationManager; +static TPPropertyAnimationManager *__manager = nil; + +// Manager declaration +@class TPPropertyAnimation; +@interface TPPropertyAnimationManager : NSObject { + id timer; + NSMutableArray *animations; +} ++ (TPPropertyAnimationManager*)manager; +- (NSArray*)allPropertyAnimationsForTarget:(id)target; +- (void)update:(id)sender; +- (void)addAnimation:(TPPropertyAnimation*)animation; +- (void)removeAnimation:(TPPropertyAnimation*)animation; +@end + +@interface TPPropertyAnimation () +@property (nonatomic, readonly) NSTimeInterval startTime; +@end + +// Main class +@implementation TPPropertyAnimation +@synthesize target, delegate, keyPath, duration, timing, fromValue, toValue, chainedAnimation, startTime, startDelay; + +- (id)initWithKeyPath:(NSString*)theKeyPath { + if ( !(self = [super init]) ) return nil; + keyPath = theKeyPath ; + timing = TPPropertyAnimationTimingEaseInEaseOut; + duration = 0.5; + startDelay = 0.0; + return self; +} + ++ (TPPropertyAnimation*)propertyAnimationWithKeyPath:(NSString*)keyPath { + return [[TPPropertyAnimation alloc] initWithKeyPath:keyPath] ; +} + ++ (NSArray*)allPropertyAnimationsForTarget:(id)target { + return [[TPPropertyAnimationManager manager] allPropertyAnimationsForTarget:target]; +} + +- (void)begin { + startTime = [NSDate timeIntervalSinceReferenceDate]; + + if ( !fromValue ) { + self.fromValue = [target valueForKey:keyPath]; + } + + [[TPPropertyAnimationManager manager] addAnimation:self]; +} + +- (void)beginWithTarget:(id)theTarget { + self.target = theTarget; + [self begin]; +} + +- (void)cancel { + [[TPPropertyAnimationManager manager] removeAnimation:self]; +} + + + +@end + + +#pragma mark - +#pragma mark Timing + +static inline CGFloat funcQuad(CGFloat ft, CGFloat f0, CGFloat f1) { + return f0 + (f1 - f0) * ft * ft; +} + +static inline CGFloat funcQuadInOut(CGFloat ft, CGFloat f0, CGFloat f1) { + CGFloat a = ((f1 - f0)/2.0); + if ( ft < 0.5 ) { + return f0 + a * (2*ft)*(2*ft); + } else { + CGFloat b = ((2*ft) - 2); + return f0 + a + ( a * (1 - (b*b)) ); + } +} + +static inline CGFloat funcQuadOut(CGFloat ft, CGFloat f0, CGFloat f1) { + return f0 + (f1 - f0) * (1.0 - (ft-1.0)*(ft-1.0)); +} + + +#pragma mark - +#pragma mark Manager + + +@implementation TPPropertyAnimationManager + ++ (TPPropertyAnimationManager*)manager { + if ( !__manager ) { + __manager = [[TPPropertyAnimationManager alloc] init]; + } + return __manager; +} + +- (NSArray*)allPropertyAnimationsForTarget:(id)target { + NSMutableArray *result = [NSMutableArray array]; + if ( animations ) { + for ( TPPropertyAnimation* animation in animations ) { + if ( animation.target == target ) [result addObject:animation]; + } + } + return result; +} + +- (void)addAnimation:(TPPropertyAnimation *)animation { + + if ( !animations ) { + animations = [[NSMutableArray alloc] init]; + } + + [animations addObject:animation]; + + if ( !timer ) { + if ( NSClassFromString(@"CADisplayLink") != NULL ) { + timer = [CADisplayLink displayLinkWithTarget:self selector:@selector(update:)]; + [timer addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode]; + } else { + timer = [NSTimer scheduledTimerWithTimeInterval:kRefreshRate target:self selector:@selector(update:) userInfo:nil repeats:YES]; + } + } +} + +- (void)removeAnimation:(TPPropertyAnimation *)animation { + [animations removeObject:animation]; + + if ( [animations count] == 0 ) { + [timer invalidate]; timer = nil; + __manager = nil; + } +} + +- (void)dealloc { + if ( timer ) [timer invalidate]; +} + +- (void)update:(id)sender { + NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate]; + for ( TPPropertyAnimation *animation in [animations copy] ) { + + if ( now < animation.startTime + animation.startDelay ) continue; // Animation hasn't started yet + + // Calculate proportion of time through animation, and the corresponding position given the timing function + NSTimeInterval time = (now - (animation.startTime+animation.startDelay)) / animation.duration; + if ( time > 1.0 ) time = 1.0; + + CGFloat position = time; + switch ( animation.timing ) { + case TPPropertyAnimationTimingEaseIn: + position = funcQuad(time, 0.0, 1.0); + break; + case TPPropertyAnimationTimingEaseOut: + position = funcQuadOut(time, 0.0, 1.0); + break; + case TPPropertyAnimationTimingEaseInEaseOut: + position = funcQuadInOut(time, 0.0, 1.0); + break; + case TPPropertyAnimationTimingLinear: + default: + break; + } + + // Determine interpolation between values given position + id value = nil; + if ( [animation.fromValue isKindOfClass:[NSNumber class]] ) { + value = [NSNumber numberWithDouble:[animation.fromValue doubleValue] + (position*([animation.toValue doubleValue] - [animation.fromValue doubleValue]))]; + } else { + NSLog(@"Unsupported property type %@", NSStringFromClass([animation.fromValue class])); + } + + // Apply new value + if ( value ) { + [animation.target setValue:value forKeyPath:animation.keyPath]; + } + + if ( time >= 1.0 ) { + // Animation has finished. Notify delegate, fire chained animation if there is one, and remove + if ( animation.delegate ) { + [animation.delegate propertyAnimationDidFinish:animation]; + } + if ( animation.chainedAnimation ) { + [animation.chainedAnimation begin]; + } + [self removeAnimation:animation]; + } + } +} +@end diff --git a/Pods/KAProgressLabel/LICENSE b/Pods/KAProgressLabel/LICENSE new file mode 100644 index 0000000..d567f2d --- /dev/null +++ b/Pods/KAProgressLabel/LICENSE @@ -0,0 +1,13 @@ + Copyright 2013 Alexis Creuzot + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/Pods/KAProgressLabel/README.md b/Pods/KAProgressLabel/README.md new file mode 100644 index 0000000..1f11e3d --- /dev/null +++ b/Pods/KAProgressLabel/README.md @@ -0,0 +1,95 @@ +#KAProgressLabel + +Minimal circular & rectangle progress label for iOS. + +####Demo1 +![KAProgressLabel](http://zippy.gfycat.com/ThriftyAdolescentAruanas.gif) + +####Demo 2 +Endless possibilities ! +![KAProgressLabel](http://i.imgur.com/XtfKAjs.png) + +##Install + +###Lame install + +* Copy the `KAProgressLabel/KAProgressLabel` folder into your project. +* Import KAProgressLabel.h from your .pch file + +###Using [cocoapods](http://cocoapods.org) + +add this line to your Podfile : +`pod 'KAProgressLabel'` + +##Usage + +###Style + +####Colors + +```objective-c +[_myProgressLabel setFillColor:[UIColor blackColor]]; +[_myProgressLabel setTrackColor:[UIColor redColor]]; +[_myProgressLabel setProgressColor:[UIColor greenColor]]; +``` + +####Widths + +```objective-c +[_myProgressLabel setTrackWidth: 2.0]; // Default to 5.0 +[_myProgressLabel setProgressWidth: 4]; // Default to 5.0 +[_myProgressLabel setRoundedCornersWidth:10]; // Default to 0 +``` + +####Start and End labels +A (very) small text can be display at the start and end of the progress arc, via 2 dedicated labels. +You can style this label any way you want. + +```objective-c +_myProgressLabel.startLabel.text = @"S"; +_myProgressLabel.endLabel.text = @"E"; +``` + +###Progress + +####Set progress +Helper function to use this component easily when it comes to progress. + +```objective-c +// Progress must be between 0 and 1 +[_myProgressLabel setProgress:0.5]; +``` + +####Set progress animated +A block is provided in order for you to change the content of the label according to your needs + +```objective-c +- (void)viewDidLoad +{ + _myProgressLabel.labelVCBlock = ^(KAProgressLabel * label) { + [label setText:[NSString stringWithFormat:@"%.0f%%", (label.progress*100)]]; + }; + + [_myProgressLabel setProgress:0.5 + timing:TPPropertyAnimationTimingEaseOut + duration:1.0 + delay:0.0]; +} +``` + +###User Interaction +You can allow the user to interact with both startDegree and endDegree. By default, user interaction is disabled. + +```objective-c +// Activate User Interaction on both sides +[_myProgressLabel setIsStartDegreeUserInteractive:YES]]; +[_myProgressLabel setIsEndDegreeUserInteractive:YES]]; +``` + +##Advanced Usage +If you need fine-tune yourself the arc to display. + +```objective-c +- (void) setStartDegree:(CGFloat)startDegree; +- (void) setEndDegree:(CGFloat)endDegree; +``` diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock new file mode 100644 index 0000000..f83935e --- /dev/null +++ b/Pods/Manifest.lock @@ -0,0 +1,10 @@ +PODS: + - KAProgressLabel (3.2) + +DEPENDENCIES: + - KAProgressLabel + +SPEC CHECKSUMS: + KAProgressLabel: 4362a1d37c5a7bc7c10cd059fd2da7cb9599cb50 + +COCOAPODS: 0.38.2 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..eab378d --- /dev/null +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,442 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 07C7A3FB023F887EA6C592E8636BC514 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10B463808E8E889395900AA8466DE468 /* Foundation.framework */; }; + 09019FD0F8FB0F62537740C51BEB77CE /* TPPropertyAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0037AD3FDD4436E59B4552AA19428B97 /* TPPropertyAnimation.h */; }; + 27AB0F887559923CA96B810B8B12A241 /* TPPropertyAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = 52A82C093D4BDD28CAEF38D03E9BB3D7 /* TPPropertyAnimation.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; + 713DC86223E1C05B5D25BF12D1C23B9A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 10B463808E8E889395900AA8466DE468 /* Foundation.framework */; }; + 72719C19BF594A6A140E181B0BED0CC8 /* KAProgressLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 9637B8705EDAC1EB9EF1D0D4484C43A4 /* KAProgressLabel.h */; }; + 9D34F19B2FA8B9E70CB7517D9B1922D2 /* Pods-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E59588C85866403F1F18569F4E07405 /* Pods-dummy.m */; }; + AC6053FA4FE4DA5B3F60E79768AD64B1 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DD64A71DB99EEA89785D8316D3AEAB5 /* QuartzCore.framework */; }; + B5CB71DF60B3A3048C695D65C99D1EE1 /* KAProgressLabel-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = ACFD0705379988BE6705A3FDAF3FEE74 /* KAProgressLabel-dummy.m */; }; + FF8F5EF09D1E2AAF7A35DE1A5441F333 /* KAProgressLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = E4DA8CCDA848A11C0E387B7414B3B3F4 /* KAProgressLabel.m */; settings = {COMPILER_FLAGS = "-DOS_OBJECT_USE_OBJC=0"; }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 0D9C5E153D6890361052760AF163C2AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1B0C341DC6ABDC779F5A3D9870924354; + remoteInfo = KAProgressLabel; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0037AD3FDD4436E59B4552AA19428B97 /* TPPropertyAnimation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = TPPropertyAnimation.h; path = KAProgressLabel/TPPropertyAnimation.h; sourceTree = ""; }; + 10B463808E8E889395900AA8466DE468 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + 15A529C27057E4A57D259CBC6E6CE49C /* Pods-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-acknowledgements.markdown"; sourceTree = ""; }; + 2DD64A71DB99EEA89785D8316D3AEAB5 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + 30D307C6574D34AFAF32D40BF985E6FB /* libKAProgressLabel.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libKAProgressLabel.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 3E59588C85866403F1F18569F4E07405 /* Pods-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-dummy.m"; sourceTree = ""; }; + 483F8F01DE12780B0F82BADE4E07E38E /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.debug.xcconfig; sourceTree = ""; }; + 52A82C093D4BDD28CAEF38D03E9BB3D7 /* TPPropertyAnimation.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = TPPropertyAnimation.m; path = KAProgressLabel/TPPropertyAnimation.m; sourceTree = ""; }; + 641AE05DD55E5E6AC1590CD7B4A18F97 /* Pods-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-resources.sh"; sourceTree = ""; }; + 95462E9221197AB8383EDDB614962617 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + 9637B8705EDAC1EB9EF1D0D4484C43A4 /* KAProgressLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = KAProgressLabel.h; path = KAProgressLabel/KAProgressLabel.h; sourceTree = ""; }; + A0F36FABA69A130AD850BA1EA0B59F9B /* KAProgressLabel-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "KAProgressLabel-prefix.pch"; sourceTree = ""; }; + ACFD0705379988BE6705A3FDAF3FEE74 /* KAProgressLabel-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "KAProgressLabel-dummy.m"; sourceTree = ""; }; + B9D4B31A965A6D02926E0B8AC766C1BA /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Pods.release.xcconfig; sourceTree = ""; }; + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + BF59BC15D23E1E1912C8F334E7236813 /* Pods-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-acknowledgements.plist"; sourceTree = ""; }; + E4DA8CCDA848A11C0E387B7414B3B3F4 /* KAProgressLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = KAProgressLabel.m; path = KAProgressLabel/KAProgressLabel.m; sourceTree = ""; }; + EF2522544003C0E950C2FE7E67908246 /* KAProgressLabel-Private.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "KAProgressLabel-Private.xcconfig"; sourceTree = ""; }; + FB31CE7748745FF8D707971738CAD159 /* KAProgressLabel.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = KAProgressLabel.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + B1BE007064449CD5A36C40087893781F /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 713DC86223E1C05B5D25BF12D1C23B9A /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CB5F9A205680FE035FBC819E0B70D7A4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 07C7A3FB023F887EA6C592E8636BC514 /* Foundation.framework in Frameworks */, + AC6053FA4FE4DA5B3F60E79768AD64B1 /* QuartzCore.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 00FC04B06EEF8A155D545C321FDCC389 /* iOS */ = { + isa = PBXGroup; + children = ( + 10B463808E8E889395900AA8466DE468 /* Foundation.framework */, + 2DD64A71DB99EEA89785D8316D3AEAB5 /* QuartzCore.framework */, + ); + name = iOS; + sourceTree = ""; + }; + 03AD79F242459CF39412059AEC8E7852 /* KAProgressLabel */ = { + isa = PBXGroup; + children = ( + 9637B8705EDAC1EB9EF1D0D4484C43A4 /* KAProgressLabel.h */, + E4DA8CCDA848A11C0E387B7414B3B3F4 /* KAProgressLabel.m */, + 0037AD3FDD4436E59B4552AA19428B97 /* TPPropertyAnimation.h */, + 52A82C093D4BDD28CAEF38D03E9BB3D7 /* TPPropertyAnimation.m */, + D18965F7738C5F9971DE150C330726A0 /* Support Files */, + ); + path = KAProgressLabel; + sourceTree = ""; + }; + 433CD3331B6C3787F473C941B61FC68F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 00FC04B06EEF8A155D545C321FDCC389 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6946D908F18140A9EB43BC17204326AE /* Pods */ = { + isa = PBXGroup; + children = ( + 03AD79F242459CF39412059AEC8E7852 /* KAProgressLabel */, + ); + name = Pods; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + BA6428E9F66FD5A23C0A2E06ED26CD2F /* Podfile */, + 433CD3331B6C3787F473C941B61FC68F /* Frameworks */, + 6946D908F18140A9EB43BC17204326AE /* Pods */, + CCA510CFBEA2D207524CDA0D73C3B561 /* Products */, + D2411A5FE7F7A004607BED49990C37F4 /* Targets Support Files */, + ); + sourceTree = ""; + }; + 952EEBFAF8F7E620423C9F156F25A506 /* Pods */ = { + isa = PBXGroup; + children = ( + 15A529C27057E4A57D259CBC6E6CE49C /* Pods-acknowledgements.markdown */, + BF59BC15D23E1E1912C8F334E7236813 /* Pods-acknowledgements.plist */, + 3E59588C85866403F1F18569F4E07405 /* Pods-dummy.m */, + 641AE05DD55E5E6AC1590CD7B4A18F97 /* Pods-resources.sh */, + 483F8F01DE12780B0F82BADE4E07E38E /* Pods.debug.xcconfig */, + B9D4B31A965A6D02926E0B8AC766C1BA /* Pods.release.xcconfig */, + ); + name = Pods; + path = "Target Support Files/Pods"; + sourceTree = ""; + }; + CCA510CFBEA2D207524CDA0D73C3B561 /* Products */ = { + isa = PBXGroup; + children = ( + 30D307C6574D34AFAF32D40BF985E6FB /* libKAProgressLabel.a */, + 95462E9221197AB8383EDDB614962617 /* libPods.a */, + ); + name = Products; + sourceTree = ""; + }; + D18965F7738C5F9971DE150C330726A0 /* Support Files */ = { + isa = PBXGroup; + children = ( + FB31CE7748745FF8D707971738CAD159 /* KAProgressLabel.xcconfig */, + EF2522544003C0E950C2FE7E67908246 /* KAProgressLabel-Private.xcconfig */, + ACFD0705379988BE6705A3FDAF3FEE74 /* KAProgressLabel-dummy.m */, + A0F36FABA69A130AD850BA1EA0B59F9B /* KAProgressLabel-prefix.pch */, + ); + name = "Support Files"; + path = "../Target Support Files/KAProgressLabel"; + sourceTree = ""; + }; + D2411A5FE7F7A004607BED49990C37F4 /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 952EEBFAF8F7E620423C9F156F25A506 /* Pods */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 8CC6CD95E4BC639A47774F731552CC57 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 72719C19BF594A6A140E181B0BED0CC8 /* KAProgressLabel.h in Headers */, + 09019FD0F8FB0F62537740C51BEB77CE /* TPPropertyAnimation.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 1B0C341DC6ABDC779F5A3D9870924354 /* KAProgressLabel */ = { + isa = PBXNativeTarget; + buildConfigurationList = 928A322196973CF42B0B0C94AA0737BD /* Build configuration list for PBXNativeTarget "KAProgressLabel" */; + buildPhases = ( + 8CDE482D04A019B0A13C4506021DE9F5 /* Sources */, + CB5F9A205680FE035FBC819E0B70D7A4 /* Frameworks */, + 8CC6CD95E4BC639A47774F731552CC57 /* Headers */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = KAProgressLabel; + productName = KAProgressLabel; + productReference = 30D307C6574D34AFAF32D40BF985E6FB /* libKAProgressLabel.a */; + productType = "com.apple.product-type.library.static"; + }; + A0C2D530A88C080B5A72372F452F86D7 /* Pods */ = { + isa = PBXNativeTarget; + buildConfigurationList = 340333ABFF84E8F8F89D2115AD8E21F5 /* Build configuration list for PBXNativeTarget "Pods" */; + buildPhases = ( + FD206202559C83CD685B48758A23BD1D /* Sources */, + B1BE007064449CD5A36C40087893781F /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 0B837BF6AC58A1ED73BAF6A22D0D0E36 /* PBXTargetDependency */, + ); + name = Pods; + productName = Pods; + productReference = 95462E9221197AB8383EDDB614962617 /* libPods.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0700; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = CCA510CFBEA2D207524CDA0D73C3B561 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1B0C341DC6ABDC779F5A3D9870924354 /* KAProgressLabel */, + A0C2D530A88C080B5A72372F452F86D7 /* Pods */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + 8CDE482D04A019B0A13C4506021DE9F5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B5CB71DF60B3A3048C695D65C99D1EE1 /* KAProgressLabel-dummy.m in Sources */, + FF8F5EF09D1E2AAF7A35DE1A5441F333 /* KAProgressLabel.m in Sources */, + 27AB0F887559923CA96B810B8B12A241 /* TPPropertyAnimation.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FD206202559C83CD685B48758A23BD1D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9D34F19B2FA8B9E70CB7517D9B1922D2 /* Pods-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 0B837BF6AC58A1ED73BAF6A22D0D0E36 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = KAProgressLabel; + target = 1B0C341DC6ABDC779F5A3D9870924354 /* KAProgressLabel */; + targetProxy = 0D9C5E153D6890361052760AF163C2AC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 29B36560B4B85E4E3D121773DB40D2FF /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B9D4B31A965A6D02926E0B8AC766C1BA /* Pods.release.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 3E372DB860D89BA283CB530FEE877F1A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EF2522544003C0E950C2FE7E67908246 /* KAProgressLabel-Private.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/KAProgressLabel/KAProgressLabel-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 511103F7F15A7E8F83B268EA03462CAB /* 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 = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + AA05AF9C3A14EE0E32F42C6E6D42D34F /* 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 = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + 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; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + ONLY_ACTIVE_ARCH = YES; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + ECFED01645AE3740E5B9E03755F869DB /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 483F8F01DE12780B0F82BADE4E07E38E /* Pods.debug.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + F3C6FFB4FC0B62442E1B90E9EE8509C3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EF2522544003C0E950C2FE7E67908246 /* KAProgressLabel-Private.xcconfig */; + buildSettings = { + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_PREFIX_HEADER = "Target Support Files/KAProgressLabel/KAProgressLabel-prefix.pch"; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AA05AF9C3A14EE0E32F42C6E6D42D34F /* Debug */, + 511103F7F15A7E8F83B268EA03462CAB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 340333ABFF84E8F8F89D2115AD8E21F5 /* Build configuration list for PBXNativeTarget "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + ECFED01645AE3740E5B9E03755F869DB /* Debug */, + 29B36560B4B85E4E3D121773DB40D2FF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 928A322196973CF42B0B0C94AA0737BD /* Build configuration list for PBXNativeTarget "KAProgressLabel" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F3C6FFB4FC0B62442E1B90E9EE8509C3 /* Debug */, + 3E372DB860D89BA283CB530FEE877F1A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Pods/Pods.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-Private.xcconfig b/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-Private.xcconfig new file mode 100644 index 0000000..fcc0e41 --- /dev/null +++ b/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-Private.xcconfig @@ -0,0 +1,6 @@ +#include "KAProgressLabel.xcconfig" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/KAProgressLabel" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KAProgressLabel" +OTHER_LDFLAGS = ${KAPROGRESSLABEL_OTHER_LDFLAGS} +PODS_ROOT = ${SRCROOT} +SKIP_INSTALL = YES \ No newline at end of file diff --git a/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-dummy.m b/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-dummy.m new file mode 100644 index 0000000..c48fee1 --- /dev/null +++ b/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_KAProgressLabel : NSObject +@end +@implementation PodsDummy_KAProgressLabel +@end diff --git a/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-prefix.pch b/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-prefix.pch new file mode 100644 index 0000000..aa992a4 --- /dev/null +++ b/Pods/Target Support Files/KAProgressLabel/KAProgressLabel-prefix.pch @@ -0,0 +1,4 @@ +#ifdef __OBJC__ +#import +#endif + diff --git a/Pods/Target Support Files/KAProgressLabel/KAProgressLabel.xcconfig b/Pods/Target Support Files/KAProgressLabel/KAProgressLabel.xcconfig new file mode 100644 index 0000000..18c152e --- /dev/null +++ b/Pods/Target Support Files/KAProgressLabel/KAProgressLabel.xcconfig @@ -0,0 +1 @@ +KAPROGRESSLABEL_OTHER_LDFLAGS = -framework "QuartzCore" \ No newline at end of file diff --git a/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown b/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown new file mode 100644 index 0000000..23372da --- /dev/null +++ b/Pods/Target Support Files/Pods/Pods-acknowledgements.markdown @@ -0,0 +1,20 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## KAProgressLabel + + Copyright 2013 Alexis Creuzot + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Generated by CocoaPods - http://cocoapods.org diff --git a/Pods/Target Support Files/Pods/Pods-acknowledgements.plist b/Pods/Target Support Files/Pods/Pods-acknowledgements.plist new file mode 100644 index 0000000..4c1a993 --- /dev/null +++ b/Pods/Target Support Files/Pods/Pods-acknowledgements.plist @@ -0,0 +1,50 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright 2013 Alexis Creuzot + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Title + KAProgressLabel + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - http://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Pods/Target Support Files/Pods/Pods-dummy.m b/Pods/Target Support Files/Pods/Pods-dummy.m new file mode 100644 index 0000000..ade64bd --- /dev/null +++ b/Pods/Target Support Files/Pods/Pods-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods : NSObject +@end +@implementation PodsDummy_Pods +@end diff --git a/Pods/Target Support Files/Pods/Pods-resources.sh b/Pods/Target Support Files/Pods/Pods-resources.sh new file mode 100755 index 0000000..ea685a2 --- /dev/null +++ b/Pods/Target Support Files/Pods/Pods-resources.sh @@ -0,0 +1,95 @@ +#!/bin/sh +set -e + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + case $1 in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" + ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" + ;; + *.framework) + echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" + xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" + xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + /*) + echo "$1" + echo "$1" >> "$RESOURCES_TO_COPY" + ;; + *) + echo "${PODS_ROOT}/$1" + echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; + esac + + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Pods/Target Support Files/Pods/Pods.debug.xcconfig b/Pods/Target Support Files/Pods/Pods.debug.xcconfig new file mode 100644 index 0000000..d4473f3 --- /dev/null +++ b/Pods/Target Support Files/Pods/Pods.debug.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KAProgressLabel" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/KAProgressLabel" +OTHER_LDFLAGS = $(inherited) -ObjC -l"KAProgressLabel" -framework "QuartzCore" +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Pods/Target Support Files/Pods/Pods.release.xcconfig b/Pods/Target Support Files/Pods/Pods.release.xcconfig new file mode 100644 index 0000000..d4473f3 --- /dev/null +++ b/Pods/Target Support Files/Pods/Pods.release.xcconfig @@ -0,0 +1,5 @@ +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/KAProgressLabel" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/KAProgressLabel" +OTHER_LDFLAGS = $(inherited) -ObjC -l"KAProgressLabel" -framework "QuartzCore" +PODS_ROOT = ${SRCROOT}/Pods \ No newline at end of file diff --git a/Stopwatch_Timer.xcodeproj/project.pbxproj b/Stopwatch_Timer.xcodeproj/project.pbxproj new file mode 100644 index 0000000..1afb105 --- /dev/null +++ b/Stopwatch_Timer.xcodeproj/project.pbxproj @@ -0,0 +1,628 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 56BEE89A2F928C0438415351 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 94054B5C1695EB8765FB4257 /* libPods.a */; }; + 5D0DE17B1B87966E0030AF64 /* SWViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D0DE17A1B87966E0030AF64 /* SWViewController.m */; }; + 5D0DE17D1B8798B30030AF64 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D0DE17C1B8798B30030AF64 /* QuartzCore.framework */; }; + 5D2A5F751B8FA9B50052A682 /* LiquidCrystal-Normal.otf in Resources */ = {isa = PBXBuildFile; fileRef = 5D2A5F741B8FA9B50052A682 /* LiquidCrystal-Normal.otf */; }; + 5D2A5F791B8FB4720052A682 /* SEViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D2A5F781B8FB4720052A682 /* SEViewController.m */; }; + 5D2A5F7C1B8FB4D40052A682 /* SpecialEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D2A5F7B1B8FB4D40052A682 /* SpecialEvent.m */; }; + 5D2A5F821B9200180052A682 /* SWAudioTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D2A5F811B9200180052A682 /* SWAudioTableViewController.m */; }; + 5D37317C1B8D471000390BB8 /* MonospaceTypewriter.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5D37317B1B8D471000390BB8 /* MonospaceTypewriter.ttf */; }; + 5D37317E1B8D49E600390BB8 /* DroidSansMono.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5D37317D1B8D49E600390BB8 /* DroidSansMono.ttf */; }; + 5DCD9DB31B926AB0009F54CE /* Beeps.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 5DCD9DAE1B926AB0009F54CE /* Beeps.mp3 */; }; + 5DCD9DB41B926AB0009F54CE /* HeavyAlarm.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 5DCD9DAF1B926AB0009F54CE /* HeavyAlarm.mp3 */; }; + 5DCD9DB51B926AB0009F54CE /* Klaxon.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 5DCD9DB01B926AB0009F54CE /* Klaxon.mp3 */; }; + 5DCD9DB61B926AB0009F54CE /* ShortAlarm.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 5DCD9DB11B926AB0009F54CE /* ShortAlarm.mp3 */; }; + 5DCD9DB71B926AB0009F54CE /* Warning.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 5DCD9DB21B926AB0009F54CE /* Warning.mp3 */; }; + C71882FD1B8E26B9004D0A26 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C71882FC1B8E26B9004D0A26 /* AVFoundation.framework */; }; + C75F426A1B94DF8C0094B9CE /* MemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C75F42691B94DF8C0094B9CE /* MemoViewController.m */; }; + C769A6DB1B878F8600F61421 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C769A6DA1B878F8600F61421 /* main.m */; }; + C769A6DE1B878F8600F61421 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C769A6DD1B878F8600F61421 /* AppDelegate.m */; }; + C769A6E41B878F8600F61421 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C769A6E21B878F8600F61421 /* Main.storyboard */; }; + C769A6E61B878F8600F61421 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C769A6E51B878F8600F61421 /* Images.xcassets */; }; + C769A6E91B878F8600F61421 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = C769A6E71B878F8600F61421 /* LaunchScreen.xib */; }; + C769A6F51B878F8600F61421 /* Stopwatch_TimerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C769A6F41B878F8600F61421 /* Stopwatch_TimerTests.m */; }; + C769A7341B884D5300F61421 /* SWTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C769A7331B884D5300F61421 /* SWTableViewController.m */; }; + C769A73C1B890E0200F61421 /* SWTimerTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C769A73B1B890E0200F61421 /* SWTimerTableViewController.m */; }; + C769A73F1B890E2100F61421 /* SWTimerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C769A73E1B890E2100F61421 /* SWTimerViewController.m */; }; + C769A7421B890E4200F61421 /* Timer.m in Sources */ = {isa = PBXBuildFile; fileRef = C769A7411B890E4200F61421 /* Timer.m */; }; + C78ED8BB1B8D4B61000BA969 /* LabelAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = C78ED8BA1B8D4B61000BA969 /* LabelAnimator.m */; }; + C7E5CEDE1B920BEE00FF4A13 /* AddPresetTimerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C7E5CEDD1B920BEE00FF4A13 /* AddPresetTimerViewController.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + C769A6EF1B878F8600F61421 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C769A6CD1B878F8600F61421 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C769A6D41B878F8600F61421; + remoteInfo = Stopwatch_Timer; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 3F5096B38A354547080DEB71 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; + 5B85230CC696EBA2A4FC2458 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; + 5D0DE1791B87966E0030AF64 /* SWViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWViewController.h; sourceTree = ""; }; + 5D0DE17A1B87966E0030AF64 /* SWViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWViewController.m; sourceTree = ""; }; + 5D0DE17C1B8798B30030AF64 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 5D2A5F741B8FA9B50052A682 /* LiquidCrystal-Normal.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "LiquidCrystal-Normal.otf"; sourceTree = ""; }; + 5D2A5F771B8FB4720052A682 /* SEViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SEViewController.h; sourceTree = ""; }; + 5D2A5F781B8FB4720052A682 /* SEViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SEViewController.m; sourceTree = ""; }; + 5D2A5F7A1B8FB4D40052A682 /* SpecialEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpecialEvent.h; sourceTree = ""; }; + 5D2A5F7B1B8FB4D40052A682 /* SpecialEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpecialEvent.m; sourceTree = ""; }; + 5D2A5F801B9200180052A682 /* SWAudioTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWAudioTableViewController.h; sourceTree = ""; }; + 5D2A5F811B9200180052A682 /* SWAudioTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWAudioTableViewController.m; sourceTree = ""; }; + 5D37317B1B8D471000390BB8 /* MonospaceTypewriter.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = MonospaceTypewriter.ttf; sourceTree = ""; }; + 5D37317D1B8D49E600390BB8 /* DroidSansMono.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = DroidSansMono.ttf; sourceTree = ""; }; + 5DCD9DAE1B926AB0009F54CE /* Beeps.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = Beeps.mp3; sourceTree = ""; }; + 5DCD9DAF1B926AB0009F54CE /* HeavyAlarm.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = HeavyAlarm.mp3; sourceTree = ""; }; + 5DCD9DB01B926AB0009F54CE /* Klaxon.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = Klaxon.mp3; sourceTree = ""; }; + 5DCD9DB11B926AB0009F54CE /* ShortAlarm.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = ShortAlarm.mp3; sourceTree = ""; }; + 5DCD9DB21B926AB0009F54CE /* Warning.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = Warning.mp3; sourceTree = ""; }; + 94054B5C1695EB8765FB4257 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; + C71882FC1B8E26B9004D0A26 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + C75F42681B94DF8C0094B9CE /* MemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoViewController.h; sourceTree = ""; }; + C75F42691B94DF8C0094B9CE /* MemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MemoViewController.m; sourceTree = ""; }; + C769A6D51B878F8600F61421 /* Stopwatch_Timer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Stopwatch_Timer.app; sourceTree = BUILT_PRODUCTS_DIR; }; + C769A6D91B878F8600F61421 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C769A6DA1B878F8600F61421 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + C769A6DC1B878F8600F61421 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + C769A6DD1B878F8600F61421 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + C769A6E31B878F8600F61421 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + C769A6E51B878F8600F61421 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; + C769A6E81B878F8600F61421 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; + C769A6EE1B878F8600F61421 /* Stopwatch_TimerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Stopwatch_TimerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + C769A6F31B878F8600F61421 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C769A6F41B878F8600F61421 /* Stopwatch_TimerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Stopwatch_TimerTests.m; sourceTree = ""; }; + C769A7321B884D5300F61421 /* SWTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWTableViewController.h; sourceTree = ""; }; + C769A7331B884D5300F61421 /* SWTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWTableViewController.m; sourceTree = ""; }; + C769A73A1B890E0200F61421 /* SWTimerTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWTimerTableViewController.h; sourceTree = ""; }; + C769A73B1B890E0200F61421 /* SWTimerTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWTimerTableViewController.m; sourceTree = ""; }; + C769A73D1B890E2100F61421 /* SWTimerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWTimerViewController.h; sourceTree = ""; }; + C769A73E1B890E2100F61421 /* SWTimerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWTimerViewController.m; sourceTree = ""; }; + C769A7401B890E4200F61421 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Timer.h; sourceTree = ""; }; + C769A7411B890E4200F61421 /* Timer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Timer.m; sourceTree = ""; }; + C78ED8B91B8D4B61000BA969 /* LabelAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelAnimator.h; sourceTree = ""; }; + C78ED8BA1B8D4B61000BA969 /* LabelAnimator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LabelAnimator.m; sourceTree = ""; }; + C7E5CEDC1B920BEE00FF4A13 /* AddPresetTimerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddPresetTimerViewController.h; sourceTree = ""; }; + C7E5CEDD1B920BEE00FF4A13 /* AddPresetTimerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddPresetTimerViewController.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + C769A6D21B878F8600F61421 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C71882FD1B8E26B9004D0A26 /* AVFoundation.framework in Frameworks */, + 5D0DE17D1B8798B30030AF64 /* QuartzCore.framework in Frameworks */, + 56BEE89A2F928C0438415351 /* libPods.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C769A6EB1B878F8600F61421 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 5D2A5F761B8FB4400052A682 /* SpecialEvents */ = { + isa = PBXGroup; + children = ( + C75F42681B94DF8C0094B9CE /* MemoViewController.h */, + C75F42691B94DF8C0094B9CE /* MemoViewController.m */, + 5D2A5F771B8FB4720052A682 /* SEViewController.h */, + 5D2A5F781B8FB4720052A682 /* SEViewController.m */, + 5D2A5F7A1B8FB4D40052A682 /* SpecialEvent.h */, + 5D2A5F7B1B8FB4D40052A682 /* SpecialEvent.m */, + ); + name = SpecialEvents; + sourceTree = ""; + }; + C6E01DB28030FC8FFE17FA7E /* Frameworks */ = { + isa = PBXGroup; + children = ( + C71882FC1B8E26B9004D0A26 /* AVFoundation.framework */, + 94054B5C1695EB8765FB4257 /* libPods.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + C769A6CC1B878F8600F61421 = { + isa = PBXGroup; + children = ( + 5D0DE17C1B8798B30030AF64 /* QuartzCore.framework */, + C769A6D71B878F8600F61421 /* Stopwatch_Timer */, + C769A6F11B878F8600F61421 /* Stopwatch_TimerTests */, + C769A6D61B878F8600F61421 /* Products */, + F74ADEB93EF183A797D490DB /* Pods */, + C6E01DB28030FC8FFE17FA7E /* Frameworks */, + ); + sourceTree = ""; + }; + C769A6D61B878F8600F61421 /* Products */ = { + isa = PBXGroup; + children = ( + C769A6D51B878F8600F61421 /* Stopwatch_Timer.app */, + C769A6EE1B878F8600F61421 /* Stopwatch_TimerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + C769A6D71B878F8600F61421 /* Stopwatch_Timer */ = { + isa = PBXGroup; + children = ( + C769A6DC1B878F8600F61421 /* AppDelegate.h */, + C769A6DD1B878F8600F61421 /* AppDelegate.m */, + C769A6E21B878F8600F61421 /* Main.storyboard */, + 5D2A5F761B8FB4400052A682 /* SpecialEvents */, + C769A7391B890D3B00F61421 /* Stopwatch */, + C769A7381B890D2D00F61421 /* Timer */, + C769A6E51B878F8600F61421 /* Images.xcassets */, + C769A6E71B878F8600F61421 /* LaunchScreen.xib */, + C769A6D81B878F8600F61421 /* Supporting Files */, + ); + path = Stopwatch_Timer; + sourceTree = ""; + }; + C769A6D81B878F8600F61421 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C769A6D91B878F8600F61421 /* Info.plist */, + C769A6DA1B878F8600F61421 /* main.m */, + 5D37317B1B8D471000390BB8 /* MonospaceTypewriter.ttf */, + 5D37317D1B8D49E600390BB8 /* DroidSansMono.ttf */, + 5D2A5F741B8FA9B50052A682 /* LiquidCrystal-Normal.otf */, + 5DCD9DAE1B926AB0009F54CE /* Beeps.mp3 */, + 5DCD9DAF1B926AB0009F54CE /* HeavyAlarm.mp3 */, + 5DCD9DB01B926AB0009F54CE /* Klaxon.mp3 */, + 5DCD9DB11B926AB0009F54CE /* ShortAlarm.mp3 */, + 5DCD9DB21B926AB0009F54CE /* Warning.mp3 */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + C769A6F11B878F8600F61421 /* Stopwatch_TimerTests */ = { + isa = PBXGroup; + children = ( + C769A6F41B878F8600F61421 /* Stopwatch_TimerTests.m */, + C769A6F21B878F8600F61421 /* Supporting Files */, + ); + path = Stopwatch_TimerTests; + sourceTree = ""; + }; + C769A6F21B878F8600F61421 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + C769A6F31B878F8600F61421 /* Info.plist */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + C769A7381B890D2D00F61421 /* Timer */ = { + isa = PBXGroup; + children = ( + C7E5CEDC1B920BEE00FF4A13 /* AddPresetTimerViewController.h */, + C7E5CEDD1B920BEE00FF4A13 /* AddPresetTimerViewController.m */, + C769A73A1B890E0200F61421 /* SWTimerTableViewController.h */, + C769A73B1B890E0200F61421 /* SWTimerTableViewController.m */, + C769A73D1B890E2100F61421 /* SWTimerViewController.h */, + C769A73E1B890E2100F61421 /* SWTimerViewController.m */, + 5D2A5F801B9200180052A682 /* SWAudioTableViewController.h */, + 5D2A5F811B9200180052A682 /* SWAudioTableViewController.m */, + C769A7401B890E4200F61421 /* Timer.h */, + C769A7411B890E4200F61421 /* Timer.m */, + C78ED8B91B8D4B61000BA969 /* LabelAnimator.h */, + C78ED8BA1B8D4B61000BA969 /* LabelAnimator.m */, + ); + name = Timer; + sourceTree = ""; + }; + C769A7391B890D3B00F61421 /* Stopwatch */ = { + isa = PBXGroup; + children = ( + 5D0DE1791B87966E0030AF64 /* SWViewController.h */, + 5D0DE17A1B87966E0030AF64 /* SWViewController.m */, + C769A7321B884D5300F61421 /* SWTableViewController.h */, + C769A7331B884D5300F61421 /* SWTableViewController.m */, + ); + name = Stopwatch; + path = Stopwatch_Timer; + sourceTree = SOURCE_ROOT; + }; + F74ADEB93EF183A797D490DB /* Pods */ = { + isa = PBXGroup; + children = ( + 3F5096B38A354547080DEB71 /* Pods.debug.xcconfig */, + 5B85230CC696EBA2A4FC2458 /* Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C769A6D41B878F8600F61421 /* Stopwatch_Timer */ = { + isa = PBXNativeTarget; + buildConfigurationList = C769A6F81B878F8600F61421 /* Build configuration list for PBXNativeTarget "Stopwatch_Timer" */; + buildPhases = ( + 8D30F8A84963EDDD7CB64191 /* Check Pods Manifest.lock */, + C769A6D11B878F8600F61421 /* Sources */, + C769A6D21B878F8600F61421 /* Frameworks */, + C769A6D31B878F8600F61421 /* Resources */, + E00A6057220BA7AE7EE78632 /* Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Stopwatch_Timer; + productName = Stopwatch_Timer; + productReference = C769A6D51B878F8600F61421 /* Stopwatch_Timer.app */; + productType = "com.apple.product-type.application"; + }; + C769A6ED1B878F8600F61421 /* Stopwatch_TimerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = C769A6FB1B878F8600F61421 /* Build configuration list for PBXNativeTarget "Stopwatch_TimerTests" */; + buildPhases = ( + C769A6EA1B878F8600F61421 /* Sources */, + C769A6EB1B878F8600F61421 /* Frameworks */, + C769A6EC1B878F8600F61421 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C769A6F01B878F8600F61421 /* PBXTargetDependency */, + ); + name = Stopwatch_TimerTests; + productName = Stopwatch_TimerTests; + productReference = C769A6EE1B878F8600F61421 /* Stopwatch_TimerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + C769A6CD1B878F8600F61421 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0640; + ORGANIZATIONNAME = "Varindra Hart"; + TargetAttributes = { + C769A6D41B878F8600F61421 = { + CreatedOnToolsVersion = 6.4; + DevelopmentTeam = 3L76772298; + }; + C769A6ED1B878F8600F61421 = { + CreatedOnToolsVersion = 6.4; + TestTargetID = C769A6D41B878F8600F61421; + }; + }; + }; + buildConfigurationList = C769A6D01B878F8600F61421 /* Build configuration list for PBXProject "Stopwatch_Timer" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = C769A6CC1B878F8600F61421; + productRefGroup = C769A6D61B878F8600F61421 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C769A6D41B878F8600F61421 /* Stopwatch_Timer */, + C769A6ED1B878F8600F61421 /* Stopwatch_TimerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + C769A6D31B878F8600F61421 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D37317E1B8D49E600390BB8 /* DroidSansMono.ttf in Resources */, + 5DCD9DB71B926AB0009F54CE /* Warning.mp3 in Resources */, + 5DCD9DB61B926AB0009F54CE /* ShortAlarm.mp3 in Resources */, + 5DCD9DB51B926AB0009F54CE /* Klaxon.mp3 in Resources */, + 5D2A5F751B8FA9B50052A682 /* LiquidCrystal-Normal.otf in Resources */, + C769A6E41B878F8600F61421 /* Main.storyboard in Resources */, + C769A6E91B878F8600F61421 /* LaunchScreen.xib in Resources */, + C769A6E61B878F8600F61421 /* Images.xcassets in Resources */, + 5DCD9DB31B926AB0009F54CE /* Beeps.mp3 in Resources */, + 5DCD9DB41B926AB0009F54CE /* HeavyAlarm.mp3 in Resources */, + 5D37317C1B8D471000390BB8 /* MonospaceTypewriter.ttf in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C769A6EC1B878F8600F61421 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 8D30F8A84963EDDD7CB64191 /* Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + E00A6057220BA7AE7EE78632 /* Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + C769A6D11B878F8600F61421 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 5D2A5F821B9200180052A682 /* SWAudioTableViewController.m in Sources */, + 5D0DE17B1B87966E0030AF64 /* SWViewController.m in Sources */, + C769A73C1B890E0200F61421 /* SWTimerTableViewController.m in Sources */, + C769A6DE1B878F8600F61421 /* AppDelegate.m in Sources */, + C75F426A1B94DF8C0094B9CE /* MemoViewController.m in Sources */, + C769A7421B890E4200F61421 /* Timer.m in Sources */, + C7E5CEDE1B920BEE00FF4A13 /* AddPresetTimerViewController.m in Sources */, + C769A6DB1B878F8600F61421 /* main.m in Sources */, + C78ED8BB1B8D4B61000BA969 /* LabelAnimator.m in Sources */, + 5D2A5F7C1B8FB4D40052A682 /* SpecialEvent.m in Sources */, + C769A73F1B890E2100F61421 /* SWTimerViewController.m in Sources */, + 5D2A5F791B8FB4720052A682 /* SEViewController.m in Sources */, + C769A7341B884D5300F61421 /* SWTableViewController.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C769A6EA1B878F8600F61421 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C769A6F51B878F8600F61421 /* Stopwatch_TimerTests.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + C769A6F01B878F8600F61421 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C769A6D41B878F8600F61421 /* Stopwatch_Timer */; + targetProxy = C769A6EF1B878F8600F61421 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + C769A6E21B878F8600F61421 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + C769A6E31B878F8600F61421 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + C769A6E71B878F8600F61421 /* LaunchScreen.xib */ = { + isa = PBXVariantGroup; + children = ( + C769A6E81B878F8600F61421 /* Base */, + ); + name = LaunchScreen.xib; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + C769A6F61B878F8600F61421 /* 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 = YES; + 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; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + 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_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + C769A6F71B878F8600F61421 /* 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 = YES; + 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; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + 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_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C769A6F91B878F8600F61421 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3F5096B38A354547080DEB71 /* Pods.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + INFOPLIST_FILE = Stopwatch_Timer/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + }; + name = Debug; + }; + C769A6FA1B878F8600F61421 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 5B85230CC696EBA2A4FC2458 /* Pods.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + INFOPLIST_FILE = Stopwatch_Timer/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; + }; + name = Release; + }; + C769A6FC1B878F8600F61421 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = Stopwatch_TimerTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stopwatch_Timer.app/Stopwatch_Timer"; + }; + name = Debug; + }; + C769A6FD1B878F8600F61421 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + ); + INFOPLIST_FILE = Stopwatch_TimerTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Stopwatch_Timer.app/Stopwatch_Timer"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + C769A6D01B878F8600F61421 /* Build configuration list for PBXProject "Stopwatch_Timer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C769A6F61B878F8600F61421 /* Debug */, + C769A6F71B878F8600F61421 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C769A6F81B878F8600F61421 /* Build configuration list for PBXNativeTarget "Stopwatch_Timer" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C769A6F91B878F8600F61421 /* Debug */, + C769A6FA1B878F8600F61421 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C769A6FB1B878F8600F61421 /* Build configuration list for PBXNativeTarget "Stopwatch_TimerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C769A6FC1B878F8600F61421 /* Debug */, + C769A6FD1B878F8600F61421 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = C769A6CD1B878F8600F61421 /* Project object */; +} diff --git a/Stopwatch_Timer.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Stopwatch_Timer.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a1a1d9a --- /dev/null +++ b/Stopwatch_Timer.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Stopwatch_Timer.xcworkspace/contents.xcworkspacedata b/Stopwatch_Timer.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..495bdde --- /dev/null +++ b/Stopwatch_Timer.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Stopwatch_Timer/AddPresetTimerViewController.h b/Stopwatch_Timer/AddPresetTimerViewController.h new file mode 100644 index 0000000..fb4dc13 --- /dev/null +++ b/Stopwatch_Timer/AddPresetTimerViewController.h @@ -0,0 +1,20 @@ +// +// AddPresetTimerViewController.h +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/29/15. +// Copyright © 2015 Varindra Hart. All rights reserved. +// + +#import + +@protocol PresetTimerAddedDelegate + +- (void) newPresetWithName:(NSString *)name timeString:(NSString *)time; + +@end + +@interface AddPresetTimerViewController : UIViewController + +@property (nonatomic, weak) iddelegate; +@end diff --git a/Stopwatch_Timer/AddPresetTimerViewController.m b/Stopwatch_Timer/AddPresetTimerViewController.m new file mode 100644 index 0000000..3bbf429 --- /dev/null +++ b/Stopwatch_Timer/AddPresetTimerViewController.m @@ -0,0 +1,96 @@ +// +// AddPresetTimerViewController.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/29/15. +// Copyright © 2015 Varindra Hart. All rights reserved. +// + +#import "AddPresetTimerViewController.h" + +@interface AddPresetTimerViewController () +@property (weak, nonatomic) IBOutlet UIDatePicker *datePicker; +@property (weak, nonatomic) IBOutlet UITextField *timerNameTextfield; +@property (weak, nonatomic) IBOutlet UIButton *addButton; + +@property (nonatomic) NSString *timeString; + +@end + +@implementation AddPresetTimerViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.datePicker.datePickerMode = UIDatePickerModeCountDownTimer; + self.timerNameTextfield.delegate = self; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +- (IBAction)addButtonTapped:(UIButton *)sender { + + [self.timerNameTextfield resignFirstResponder]; + + if (self.timerNameTextfield.text == nil || [self.timerNameTextfield.text isEqualToString: @""]) { + [self showAlert:@"Don't forget to add a timer name"]; + return; + } + + + BOOL validDate = [self readDatePicker]; + + if (validDate) { + + + [self.delegate newPresetWithName:self.timerNameTextfield.text timeString:self.timeString]; + + [self.navigationController popToRootViewControllerAnimated:YES]; + + } + + +} + +- (void)showAlert:(NSString *)error{ + + UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Almost there!" message:error delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; + [alert show]; +} + +- (BOOL) readDatePicker{ + + NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; + [outputFormatter setDateFormat:@"k:mm"]; + self.timeString = [outputFormatter stringFromDate:self.datePicker.date]; + if ([self.timeString isEqualToString:@"24:00"]) { + [self showAlert:@"Time cannot be 0 hours 0 seconds"]; + return NO; + } + + return YES; + + +} + + +-(BOOL) textFieldShouldReturn:(UITextField *)textField{ + + [textField resignFirstResponder]; + return YES; +} +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Stopwatch_Timer/AppDelegate.h b/Stopwatch_Timer/AppDelegate.h new file mode 100644 index 0000000..dc7ba00 --- /dev/null +++ b/Stopwatch_Timer/AppDelegate.h @@ -0,0 +1,17 @@ +// +// AppDelegate.h +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/21/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/Stopwatch_Timer/AppDelegate.m b/Stopwatch_Timer/AppDelegate.m new file mode 100644 index 0000000..6683728 --- /dev/null +++ b/Stopwatch_Timer/AppDelegate.m @@ -0,0 +1,48 @@ +// +// AppDelegate.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/21/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + + [[UITabBar appearance] setTintColor:[UIColor grayColor]]; + + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/Stopwatch_Timer/Base.lproj/LaunchScreen.xib b/Stopwatch_Timer/Base.lproj/LaunchScreen.xib new file mode 100644 index 0000000..d4f1e5f --- /dev/null +++ b/Stopwatch_Timer/Base.lproj/LaunchScreen.xib @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Stopwatch_Timer/Base.lproj/Main.storyboard b/Stopwatch_Timer/Base.lproj/Main.storyboard new file mode 100644 index 0000000..c1478de --- /dev/null +++ b/Stopwatch_Timer/Base.lproj/Main.storyboard @@ -0,0 +1,1099 @@ + + + + + + + + + + LiquidCrystal-Regular + LiquidCrystal-Regular + LiquidCrystal-Regular + LiquidCrystal-Regular + LiquidCrystal-Regular + LiquidCrystal-Regular + LiquidCrystal-Regular + LiquidCrystal-Regular + LiquidCrystal-Regular + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Stopwatch_Timer/Beeps.mp3 b/Stopwatch_Timer/Beeps.mp3 new file mode 100644 index 0000000..53ae697 Binary files /dev/null and b/Stopwatch_Timer/Beeps.mp3 differ diff --git a/Stopwatch_Timer/DroidSansMono.ttf b/Stopwatch_Timer/DroidSansMono.ttf new file mode 100755 index 0000000..a007071 Binary files /dev/null and b/Stopwatch_Timer/DroidSansMono.ttf differ diff --git a/Stopwatch_Timer/HeavyAlarm.mp3 b/Stopwatch_Timer/HeavyAlarm.mp3 new file mode 100644 index 0000000..e0db72e Binary files /dev/null and b/Stopwatch_Timer/HeavyAlarm.mp3 differ diff --git a/Stopwatch_Timer/Images.xcassets/AppIcon.appiconset/Contents.json b/Stopwatch_Timer/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..118c98f --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/Contents.json b/Stopwatch_Timer/Images.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/Post-it-note.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/Post-it-note.imageset/Contents.json new file mode 100644 index 0000000..0300599 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/Post-it-note.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Post-it-note.jpeg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/Post-it-note.imageset/Post-it-note.jpeg b/Stopwatch_Timer/Images.xcassets/Post-it-note.imageset/Post-it-note.jpeg new file mode 100644 index 0000000..5ab4445 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/Post-it-note.imageset/Post-it-note.jpeg differ diff --git a/Stopwatch_Timer/Images.xcassets/audio-wave-2-xxl.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/audio-wave-2-xxl.imageset/Contents.json new file mode 100644 index 0000000..7dea8fe --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/audio-wave-2-xxl.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "audio-wave-2-xxl.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/audio-wave-2-xxl.imageset/audio-wave-2-xxl.png b/Stopwatch_Timer/Images.xcassets/audio-wave-2-xxl.imageset/audio-wave-2-xxl.png new file mode 100644 index 0000000..ea287b1 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/audio-wave-2-xxl.imageset/audio-wave-2-xxl.png differ diff --git a/Stopwatch_Timer/Images.xcassets/background1_timer.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/background1_timer.imageset/Contents.json new file mode 100644 index 0000000..2bb7577 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/background1_timer.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "background1_timer.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/background1_timer.imageset/background1_timer.jpg b/Stopwatch_Timer/Images.xcassets/background1_timer.imageset/background1_timer.jpg new file mode 100644 index 0000000..67c6ce4 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/background1_timer.imageset/background1_timer.jpg differ diff --git a/Stopwatch_Timer/Images.xcassets/background2_timer.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/background2_timer.imageset/Contents.json new file mode 100644 index 0000000..563521e --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/background2_timer.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "background2_timer.jpeg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/background2_timer.imageset/background2_timer.jpeg b/Stopwatch_Timer/Images.xcassets/background2_timer.imageset/background2_timer.jpeg new file mode 100644 index 0000000..43fc239 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/background2_timer.imageset/background2_timer.jpeg differ diff --git a/Stopwatch_Timer/Images.xcassets/background3_timer.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/background3_timer.imageset/Contents.json new file mode 100644 index 0000000..f72e5ae --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/background3_timer.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "background3_timer.jpeg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/background3_timer.imageset/background3_timer.jpeg b/Stopwatch_Timer/Images.xcassets/background3_timer.imageset/background3_timer.jpeg new file mode 100644 index 0000000..5468947 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/background3_timer.imageset/background3_timer.jpeg differ diff --git a/Stopwatch_Timer/Images.xcassets/calendar.imageset/42416.png b/Stopwatch_Timer/Images.xcassets/calendar.imageset/42416.png new file mode 100644 index 0000000..a552392 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/calendar.imageset/42416.png differ diff --git a/Stopwatch_Timer/Images.xcassets/calendar.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/calendar.imageset/Contents.json new file mode 100644 index 0000000..472b7d8 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/calendar.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "42416.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/music-2.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/music-2.imageset/Contents.json new file mode 100644 index 0000000..4d0044d --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/music-2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "music-2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/music-2.imageset/music-2.png b/Stopwatch_Timer/Images.xcassets/music-2.imageset/music-2.png new file mode 100644 index 0000000..4a939b6 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/music-2.imageset/music-2.png differ diff --git a/Stopwatch_Timer/Images.xcassets/music.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/music.imageset/Contents.json new file mode 100644 index 0000000..9d0e863 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/music.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "music.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/music.imageset/music.png b/Stopwatch_Timer/Images.xcassets/music.imageset/music.png new file mode 100644 index 0000000..e6d93c0 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/music.imageset/music.png differ diff --git a/Stopwatch_Timer/Images.xcassets/star_blue.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/star_blue.imageset/Contents.json new file mode 100644 index 0000000..7fd4167 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/star_blue.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "star-4-xxl.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/star_blue.imageset/star-4-xxl.png b/Stopwatch_Timer/Images.xcassets/star_blue.imageset/star-4-xxl.png new file mode 100644 index 0000000..d4e888b Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/star_blue.imageset/star-4-xxl.png differ diff --git a/Stopwatch_Timer/Images.xcassets/star_gold.imageset/678064-star-128.png b/Stopwatch_Timer/Images.xcassets/star_gold.imageset/678064-star-128.png new file mode 100644 index 0000000..adfc8f6 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/star_gold.imageset/678064-star-128.png differ diff --git a/Stopwatch_Timer/Images.xcassets/star_gold.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/star_gold.imageset/Contents.json new file mode 100644 index 0000000..7e2d8b1 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/star_gold.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "678064-star-128.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/stopwatch.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/stopwatch.imageset/Contents.json new file mode 100644 index 0000000..9ed8220 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/stopwatch.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "stopwatch_alarm_speed_sport_time_clock_watch-512.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/stopwatch.imageset/stopwatch_alarm_speed_sport_time_clock_watch-512.png b/Stopwatch_Timer/Images.xcassets/stopwatch.imageset/stopwatch_alarm_speed_sport_time_clock_watch-512.png new file mode 100644 index 0000000..c749628 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/stopwatch.imageset/stopwatch_alarm_speed_sport_time_clock_watch-512.png differ diff --git a/Stopwatch_Timer/Images.xcassets/timer.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/timer.imageset/Contents.json new file mode 100644 index 0000000..e24b685 --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/timer.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "timer-2.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/timer.imageset/timer-2.png b/Stopwatch_Timer/Images.xcassets/timer.imageset/timer-2.png new file mode 100644 index 0000000..c8522c4 Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/timer.imageset/timer-2.png differ diff --git a/Stopwatch_Timer/Images.xcassets/voicememos_icon.imageset/Contents.json b/Stopwatch_Timer/Images.xcassets/voicememos_icon.imageset/Contents.json new file mode 100644 index 0000000..1f83f9a --- /dev/null +++ b/Stopwatch_Timer/Images.xcassets/voicememos_icon.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "voicememos_icon.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Stopwatch_Timer/Images.xcassets/voicememos_icon.imageset/voicememos_icon.png b/Stopwatch_Timer/Images.xcassets/voicememos_icon.imageset/voicememos_icon.png new file mode 100644 index 0000000..e8644af Binary files /dev/null and b/Stopwatch_Timer/Images.xcassets/voicememos_icon.imageset/voicememos_icon.png differ diff --git a/Stopwatch_Timer/Info.plist b/Stopwatch_Timer/Info.plist new file mode 100644 index 0000000..c4f3429 --- /dev/null +++ b/Stopwatch_Timer/Info.plist @@ -0,0 +1,44 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + nyc.c4q.vhart.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIAppFonts + + MonospaceTypewriter.ttf + LiquidCrystal-Normal.otf + DroidSansMono.ttf + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + + diff --git a/Stopwatch_Timer/Klaxon.mp3 b/Stopwatch_Timer/Klaxon.mp3 new file mode 100644 index 0000000..0eb4209 Binary files /dev/null and b/Stopwatch_Timer/Klaxon.mp3 differ diff --git a/Stopwatch_Timer/LabelAnimator.h b/Stopwatch_Timer/LabelAnimator.h new file mode 100644 index 0000000..ff53417 --- /dev/null +++ b/Stopwatch_Timer/LabelAnimator.h @@ -0,0 +1,52 @@ +// +// LabelAnimator.h +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/25/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import +#import "KAProgressLabel.h" +#import + +//RGB color macro +#define UIColorFromRGB(rgbValue) [UIColor \ +colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ +green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ +blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] + +//RGB color macro with alpha +#define UIColorFromRGBWithAlpha(rgbValue,a) [UIColor \ +colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \ +green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \ +blue:((float)(rgbValue & 0xFF))/255.0 alpha:a] + +@interface LabelAnimator : NSObject + +@property (nonatomic) KAProgressLabel * smallLabel; +@property (nonatomic) KAProgressLabel * mediumLabel; +@property (nonatomic) KAProgressLabel * largeLabel; + + +//Only use this init method for concentric circles. Defaulted to 3 circles. Use regular init method if you only need a manager class object to manage your circles. +- (instancetype)initWithLabels:(KAProgressLabel *)small medium:(KAProgressLabel *)medium large:(KAProgressLabel *)large; + +//fill color is color everywhere in the label EXCEPT for the track and progress, essentially anything but the circle itself. Track is literally a track for the progress bar to load onto. Progress is the progress bar that gets updated. +- (void)setUpLabel:(KAProgressLabel *)label withColorsProgressColor:(UIColor *)progress trackColor:(UIColor *)track fillColor:(UIColor *)fill; + +//For nice smooth curves make corner width = to progress width; +-(void)setUpDimensionsForLabel:(KAProgressLabel *)label trackWidth:(CGFloat)track progressWidth:(CGFloat)progress roundedCornersWidth:(CGFloat)corners; + +//Modify this method to set default settings for your label, then pass in a label and it will be customized to your default. +- (void)setUpLabelWithCustomDefaults:(KAProgressLabel *)label; + + +//Method to set up property labels as you see fit. +- (void)setUpAllPropertyLabels; + +//customize this method to load up your progress bars. Will ONLY work for circles that are set to the label properties above. +- (void)update; +- (void)updateWithOriginal:(double)old new:(double)newValue; +- (void)reset; +@end diff --git a/Stopwatch_Timer/LabelAnimator.m b/Stopwatch_Timer/LabelAnimator.m new file mode 100644 index 0000000..d10c94b --- /dev/null +++ b/Stopwatch_Timer/LabelAnimator.m @@ -0,0 +1,126 @@ +// +// LabelAnimator.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/25/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "LabelAnimator.h" +#import + + +@implementation LabelAnimator + +-(instancetype)initWithLabels:(KAProgressLabel *)small medium:(KAProgressLabel *)medium large:(KAProgressLabel *)large{ + if(self = [super init]){ + self.smallLabel = small; + self.mediumLabel = medium; + self.largeLabel = large; + + return self; + } + + return nil; +} + +- (void) setUpLabelWithCustomDefaults:(KAProgressLabel *)label{ + + //modify +} + +- (void)setUpLabel:(KAProgressLabel *)label withColorsProgressColor:(UIColor *)progress trackColor:(UIColor *)track fillColor:(UIColor *)fill{ + + + [label setProgressColor:progress]; // black progress bar + [label setTrackColor:track]; // gray track bar + [label setFillColor:fill]; // + +// label.labelVCBlock = ^(KAProgressLabel *label_) { +// label.text = [NSString stringWithFormat:@"%.0f%%", (label.progress * 100)]; +// }; + +// [label setProgress:0.0 +// timing:TPPropertyAnimationTimingEaseOut +// duration:0.0 +// delay:0.0]; + +} + +- (void)setUpDimensionsForLabel:(KAProgressLabel *)label trackWidth:(CGFloat)track progressWidth:(CGFloat)progress roundedCornersWidth:(CGFloat)corners{ + + label.trackWidth = track; // Defaults to 5.0 + label.progressWidth = progress; // Defaults to 5.0 + label.roundedCornersWidth = corners; // Defaults to 0 + [label setUserInteractionEnabled:NO]; + +} + +-(void)setUpAllPropertyLabels{ + + [self setUpDimensionsForLabel:self.smallLabel trackWidth:6.0f progressWidth:8.0f roundedCornersWidth:8.0f]; + [self setUpDimensionsForLabel:self.mediumLabel trackWidth:6.0f progressWidth:8.0f roundedCornersWidth:8.0f]; + [self setUpDimensionsForLabel:self.largeLabel trackWidth:6.0f progressWidth:8.0f roundedCornersWidth:8.0f]; + + [self setUpLabel:self.smallLabel withColorsProgressColor:UIColorFromRGB(0x53CFF5) trackColor:UIColorFromRGBWithAlpha(0x5882DB, 1) fillColor:[UIColor clearColor]]; + + [self setUpLabel:self.mediumLabel withColorsProgressColor:UIColorFromRGB(0x25EF00) trackColor:UIColorFromRGBWithAlpha(0x82FA86, .7) fillColor:[UIColor clearColor]]; + + [self setUpLabel:self.largeLabel withColorsProgressColor:UIColorFromRGB(0xFF0000) trackColor:UIColorFromRGBWithAlpha(0xFF9494, 1) fillColor:[UIColor clearColor]]; + // 0xFF9494 +} + +- (void)reset{ + [self.smallLabel setProgress:0.0]; + [self.mediumLabel setProgress:0.0]; + [self.largeLabel setProgress:0.0]; +} + + +- (void)update{ + + CGFloat progress = self.smallLabel.progress + (2.0f / 1500.0f); + CGFloat progressTwo; + [self.smallLabel setProgress:progress]; + if (progress>=1.0) { + progress-=1.0; + [self.smallLabel setProgress:progress]; + progressTwo = self.mediumLabel.progress + (1.0f/60.0f); + [self.mediumLabel setProgress:progressTwo]; + } + if (progressTwo>=1.0) { + [self.mediumLabel setProgress:(progressTwo-1.0f)]; + [self.largeLabel setProgress:self.largeLabel.progress+ 1.0/24.0f]; + } + + +} + +- (void)updateWithOriginal:(double)old new:(double)newValue{ + + CGFloat perc = newValue/old; + + if (perc >= .6667) { + [self.smallLabel setProgress:1.0]; + [self.mediumLabel setProgress:1.0]; + [self.largeLabel setProgress: perc>=1? 1 : ((perc - .6667)/.3333)]; + return; + } + + if (perc >.3334) { + [self.smallLabel setProgress:1.0]; + [self.mediumLabel setProgress:((perc - .3333)/.3333)]; + [self.largeLabel setProgress:0]; + return; + } + + if (perc <= .3334) { + [self.smallLabel setProgress: perc>=0? ((perc)/.3334) : 0]; + [self.mediumLabel setProgress:0]; + [self.largeLabel setProgress:0]; + return; + } + +} + +@end diff --git a/Stopwatch_Timer/LiquidCrystal-Normal.otf b/Stopwatch_Timer/LiquidCrystal-Normal.otf new file mode 100755 index 0000000..9fbb4bd Binary files /dev/null and b/Stopwatch_Timer/LiquidCrystal-Normal.otf differ diff --git a/Stopwatch_Timer/MemoViewController.h b/Stopwatch_Timer/MemoViewController.h new file mode 100644 index 0000000..df7d3d6 --- /dev/null +++ b/Stopwatch_Timer/MemoViewController.h @@ -0,0 +1,17 @@ +// +// MemoViewController.h +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/31/15. +// Copyright © 2015 Varindra Hart. All rights reserved. +// + +#import +#import "SpecialEvent.h" + + +@interface MemoViewController : UIViewController + +@property (nonatomic) SpecialEvent *event; + +@end diff --git a/Stopwatch_Timer/MemoViewController.m b/Stopwatch_Timer/MemoViewController.m new file mode 100644 index 0000000..1a48b5b --- /dev/null +++ b/Stopwatch_Timer/MemoViewController.m @@ -0,0 +1,115 @@ +// +// MemoViewController.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/31/15. +// Copyright © 2015 Varindra Hart. All rights reserved. +// + +#import "MemoViewController.h" + +@interface MemoViewController () +@property (nonatomic) IBOutlet UITableView * eventsTableView; +@property (nonatomic, weak) IBOutlet UITextField * textField; +@property (weak, nonatomic) IBOutlet UIButton *AddButton; + +@end + +@implementation MemoViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.textField.delegate = self; + self.eventsTableView.delegate = self; + self.eventsTableView.dataSource = self; + self.eventsTableView.allowsMultipleSelectionDuringEditing = NO; + + self.navigationItem.title = [NSString stringWithFormat:@"%@ Memos",self.event.name]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ + NSLog(@"touchesBegan:withEvent:"); + [self.view endEditing:YES]; + [super touchesBegan:touches withEvent:event]; +} + + +- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ + if (self.event.memos == nil) { + self.event.memos = [NSMutableArray new]; + }; + + return [self.event.memos count]; +} + +- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView{ + return 1; +} + +- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MemoCellIdentifier" forIndexPath:indexPath]; + + cell.textLabel.text = self.event.memos[indexPath.row]; + + return cell; +} + +- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath{ + // +} + +- (IBAction)addEventButton:(UIButton *)sender{ + if (self.textField.text.length == 0) { + return; + } + else{ + [self.event.memos addObject:[NSString stringWithFormat:@"%@",self.textField.text]]; + self.textField.text = @""; + [self.eventsTableView reloadData]; + + } + +} + +- (BOOL)textFieldShouldReturn:(UITextField *)textField{ + [self.textField resignFirstResponder]; + [self addEventButton:self.AddButton]; + return YES; +} + + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + + + return YES; +} + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + [self.event.memos removeObjectAtIndex:indexPath.row]; + [self.eventsTableView reloadData]; + //[self.presetArrayOfDictionaries ] + } +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Stopwatch_Timer/MonospaceTypewriter.ttf b/Stopwatch_Timer/MonospaceTypewriter.ttf new file mode 100755 index 0000000..29e9a67 Binary files /dev/null and b/Stopwatch_Timer/MonospaceTypewriter.ttf differ diff --git a/Stopwatch_Timer/SEViewController.h b/Stopwatch_Timer/SEViewController.h new file mode 100644 index 0000000..f61ece9 --- /dev/null +++ b/Stopwatch_Timer/SEViewController.h @@ -0,0 +1,14 @@ +// +// SEViewController.h +// Stopwatch_Timer +// +// Created by Jackie Meggesto on 8/27/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import +#import "SpecialEvent.h" + +@interface SEViewController : UIViewController + +@end diff --git a/Stopwatch_Timer/SEViewController.m b/Stopwatch_Timer/SEViewController.m new file mode 100644 index 0000000..88404f1 --- /dev/null +++ b/Stopwatch_Timer/SEViewController.m @@ -0,0 +1,217 @@ +// +// SEViewController.m +// Stopwatch_Timer +// +// Created by Jackie Meggesto on 8/27/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "SEViewController.h" +#import "MemoViewController.h" + + +@interface SEViewController () + +@property (nonatomic) NSMutableArray *eventsArray; +@property (nonatomic) NSTimer* eventsTimer; +@property (weak, nonatomic) IBOutlet UIDatePicker *eventDatePicker; +@property (weak, nonatomic) IBOutlet UITextField *eventNameField; +@property (weak, nonatomic) IBOutlet UITableView *eventsTableView; + + +@end + +@implementation SEViewController + +// In each tabbed view controller +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + if (self = [super initWithCoder:aDecoder]) { + + // non-selected tab bar image + UIImage *defaultImage = [[UIImage imageNamed:@"calendar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; + + // selected tab bar image + UIImage *selectedImage = [[UIImage imageNamed:@"calendar"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; + + // set the tab bar item with a title and both images + self.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Events" image:defaultImage selectedImage:selectedImage]; + return self; + } + return nil; +} + +- (void)viewDidLoad { + + [super viewDidLoad]; + self.navigationItem.title = @"Special Events Countdown"; + self.eventsTableView.allowsMultipleSelectionDuringEditing = NO; + + self.eventDatePicker.minimumDate = [NSDate dateWithTimeInterval:(24*60*60) sinceDate:[NSDate date]];; + + self.eventsTableView.dataSource = self; + self.eventsTableView.delegate = self; + self.eventNameField.delegate = self; + self.eventsArray = [[NSMutableArray alloc] init]; + + NSDate *now = [NSDate date]; + + SpecialEvent *halloween = [[SpecialEvent alloc]init]; + SpecialEvent *thanksgiving = [[SpecialEvent alloc]init]; + SpecialEvent *christmas = [[SpecialEvent alloc]init]; + SpecialEvent *newYears = [[SpecialEvent alloc]init]; + + halloween.name = @"Halloween"; + thanksgiving.name = @"Thanksgiving"; + christmas.name = @"Christmas"; + newYears.name = @"New Years"; + + + NSDateFormatter* halloweenFormatter = [[NSDateFormatter alloc]init]; + [halloweenFormatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *halloweenDate = [halloweenFormatter dateFromString:@"2015-10-31"]; + halloween.time = [halloweenDate timeIntervalSinceDate:now]; + [self.eventsArray addObject:halloween]; + + NSDateFormatter* thanksgivingFormatter = [[NSDateFormatter alloc]init]; + [thanksgivingFormatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *thanksgivingDate = [halloweenFormatter dateFromString:@"2015-11-26"]; + thanksgiving.time = [thanksgivingDate timeIntervalSinceDate:now]; + [self.eventsArray addObject:thanksgiving]; + + NSDateFormatter* christmasFormatter = [[NSDateFormatter alloc]init]; + [christmasFormatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *christmasDate = [halloweenFormatter dateFromString:@"2015-12-25"]; + christmas.time = [christmasDate timeIntervalSinceDate:now]; + [self.eventsArray addObject:christmas]; + + NSDateFormatter* newYearFormatter = [[NSDateFormatter alloc]init]; + [newYearFormatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *newYearDate = [halloweenFormatter dateFromString:@"2016-01-01"]; + newYears.time = [newYearDate timeIntervalSinceDate:now]; + [self.eventsArray addObject:newYears]; + + + + [self setUpEventsTimer]; + + +} +-(NSString*)timeFormattedWithValue:(double)value { + + double time = value; + int DD = time/86400; + time = time - (86400 * DD); + int hours = 3600; + + + + + + int HH = time / hours; + + + time = time - (3600 * HH); + int MM = time / 60; + time = time - 60 * MM; + int SS = floor(time); + + + + return [NSString stringWithFormat:@"%.2d:%.2d:%.2d:%.2d", DD, HH, MM, SS]; + +} +-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + + return [self.eventsArray count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SpecialEventCell" forIndexPath:indexPath]; + + SpecialEvent *eventForCell = self.eventsArray[indexPath.row]; + cell.textLabel.text = eventForCell.name; + cell.detailTextLabel.text = [self timeFormattedWithValue:eventForCell.time]; + + if (indexPath.row>=[self.eventsArray count]-4) { + [cell.textLabel setTextColor:[UIColor colorWithRed:80.0f/255.0f green:170.0f/255.0f blue:255.0f/255.0f alpha:1.0f]]; + } + else{ + [cell.textLabel setTextColor:[UIColor redColor]]; + } + + + return cell; +} + +-(void)setUpEventsTimer{ + self.eventsTimer = [NSTimer timerWithTimeInterval:1.0 target:self selector:@selector(fireEventsTimer) userInfo:nil repeats:YES]; + [[NSRunLoop mainRunLoop] addTimer:self.eventsTimer forMode:NSRunLoopCommonModes]; +} +-(void)fireEventsTimer { + for (SpecialEvent* event in self.eventsArray) { + event.time --; + } + [self.eventsTableView reloadData]; + + +} +- (IBAction)addEvent:(id)sender { + + if ([self.eventNameField.text isEqualToString:@""]) { + + UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Please select a name" message:@"You must select a name for your event." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil]; + [alert show]; + } else { + SpecialEvent *newEvent = [[SpecialEvent alloc]init ]; + NSDate* now = [NSDate date]; + newEvent.time = [self.eventDatePicker.date timeIntervalSinceDate:now]; + newEvent.name = self.eventNameField.text; + + + [self.eventsArray insertObject:newEvent atIndex:0]; + [self.eventNameField resignFirstResponder]; + [self.eventsTableView reloadData]; + + } + +} + +-(BOOL)textFieldShouldReturn:(UITextField *)textField { + [self.eventNameField resignFirstResponder]; + return YES; +} + + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return YES if you want the specified item to be editable. + NSLog(@"%lu",indexPath.row); + if ([self.eventsArray count]-4 > indexPath.row ) { + + return YES; + } + + return NO; +} + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + [self.eventsArray removeObjectAtIndex:indexPath.row]; + [self.eventsTableView reloadData]; + //[self.presetArrayOfDictionaries ] + } +} + +- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath{ + MemoViewController *memoVC = [self.storyboard instantiateViewControllerWithIdentifier:@"MemoViewController"]; + memoVC.event = self.eventsArray[indexPath.row]; + + [self.navigationController pushViewController:memoVC animated:YES]; +} + +@end diff --git a/Stopwatch_Timer/SWAudioTableViewController.h b/Stopwatch_Timer/SWAudioTableViewController.h new file mode 100644 index 0000000..56af152 --- /dev/null +++ b/Stopwatch_Timer/SWAudioTableViewController.h @@ -0,0 +1,25 @@ +// +// SWAudioTableViewController.h +// Stopwatch_Timer +// +// Created by Jackie Meggesto on 8/29/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import + +@class SWAudioTableViewController; +@protocol SWAudioSelectorDelegate + +@optional + +-(void)didSelectAudioFilename:(NSString*)string; + +@end + +@interface SWAudioTableViewController : UITableViewController + +@property (nonatomic,weak) iddelegate; +@property (nonatomic) NSString* oldSelection; + +@end diff --git a/Stopwatch_Timer/SWAudioTableViewController.m b/Stopwatch_Timer/SWAudioTableViewController.m new file mode 100644 index 0000000..8d5d74b --- /dev/null +++ b/Stopwatch_Timer/SWAudioTableViewController.m @@ -0,0 +1,91 @@ +// +// SWAudioTableViewController.m +// Stopwatch_Timer +// +// Created by Jackie Meggesto on 8/29/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import +#import "SWAudioTableViewController.h" + +@interface SWAudioTableViewController () + +@property (nonatomic) NSArray *audioNames; +@property (nonatomic) NSIndexPath *selectionIndexPath; +@property (nonatomic) AVAudioPlayer* audioSampler; +@property (nonatomic) NSString* stringToPass; + + +@end + +@implementation SWAudioTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.audioNames = [[NSArray alloc] initWithObjects:@"Beeps", @"HeavyAlarm", @"ShortAlarm", @"Klaxon", @"Warning", nil]; + +} + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { +#warning Potentially incomplete method implementation. + + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { +#warning Incomplete method implementation. + + return self.audioNames.count; +} + +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { + [self.audioSampler stop]; + NSString* audioString = [NSString stringWithFormat:@"%@/%@.mp3", [[NSBundle mainBundle] resourcePath], self.audioNames[indexPath.row]]; + + NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: audioString]; + + self.audioSampler = + [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL + error: nil]; + [self.audioSampler play]; + + self.selectionIndexPath = indexPath; + self.stringToPass = self.audioNames[indexPath.row]; + self.oldSelection = self.audioNames[indexPath.row]; + NSLog(@"%@", self.stringToPass); + [self.tableView reloadData]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AudioTableViewCell" forIndexPath:indexPath]; + + cell.detailTextLabel.text = self.audioNames[indexPath.row]; + + if ([self.selectionIndexPath isEqual:indexPath] || [self.audioNames[indexPath.row] isEqualToString:self.oldSelection]) { + cell.accessoryType = UITableViewCellAccessoryCheckmark; + } else { + cell.accessoryType = UITableViewCellAccessoryNone; + } + + + return cell; +} + +-(void)viewWillDisappear:(BOOL)animated { + + if (self.stringToPass == nil) { + [self.delegate didSelectAudioFilename:self.oldSelection]; + } else { + [self.delegate didSelectAudioFilename:self.stringToPass]; + + } + + NSLog(@"%@", self.stringToPass); + +} + + +@end diff --git a/Stopwatch_Timer/SWTableViewController.h b/Stopwatch_Timer/SWTableViewController.h new file mode 100644 index 0000000..b9d6b3d --- /dev/null +++ b/Stopwatch_Timer/SWTableViewController.h @@ -0,0 +1,15 @@ +// +// SWTableViewController.h +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/22/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import + +@interface SWTableViewController : UITableViewController + +@property (nonatomic) NSMutableArray *lapTimesArray; + +@end diff --git a/Stopwatch_Timer/SWTableViewController.m b/Stopwatch_Timer/SWTableViewController.m new file mode 100644 index 0000000..75efebb --- /dev/null +++ b/Stopwatch_Timer/SWTableViewController.m @@ -0,0 +1,53 @@ +// +// SWTableViewController.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/22/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "SWTableViewController.h" + +@interface SWTableViewController () + +@end + +@implementation SWTableViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.lapTimesArray = [[NSMutableArray alloc] init]; + +} + + + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + + return self.lapTimesArray.count; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"LapsCellIdentifier" forIndexPath:indexPath]; + + cell.textLabel.text = [NSString stringWithFormat:@"Lap %lu",self.lapTimesArray.count - indexPath.row]; + cell.detailTextLabel.text = [NSString stringWithFormat:@"%.2lf",[self.lapTimesArray[indexPath.row] doubleValue]]; + cell.detailTextLabel.font = [UIFont fontWithName:@"Liquid Crystal" size:17.0]; + + return cell; +} + + + + +@end diff --git a/Stopwatch_Timer/SWTimerTableViewController.h b/Stopwatch_Timer/SWTimerTableViewController.h new file mode 100644 index 0000000..4f002ee --- /dev/null +++ b/Stopwatch_Timer/SWTimerTableViewController.h @@ -0,0 +1,28 @@ +// +// SWTimerTableViewController.h +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/22/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import +#import "Timer.h" +#import "AddPresetTimerViewController.h" + +@protocol SWTimerTableViewDelegate + +@optional + +- (void) dictionaryForTimerSelected:(NSDictionary *)dictionary; + +@end + +@interface SWTimerTableViewController : UITableViewController + +@property (nonatomic) NSMutableArray *presetArrayOfDictionaries; +@property (nonatomic,weak) iddelegate; + +@end + + diff --git a/Stopwatch_Timer/SWTimerTableViewController.m b/Stopwatch_Timer/SWTimerTableViewController.m new file mode 100644 index 0000000..8ccb84b --- /dev/null +++ b/Stopwatch_Timer/SWTimerTableViewController.m @@ -0,0 +1,150 @@ +// +// SWTimerTableViewController.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/22/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "SWTimerTableViewController.h" +#import "SWTimerViewController.h" +#import "Timer.h" + +@interface SWTimerTableViewController () + +@end + +@implementation SWTimerTableViewController + +- (void)viewDidLoad { + + [super viewDidLoad]; + + self.tableView.allowsMultipleSelectionDuringEditing = NO; + + self.presetArrayOfDictionaries = [[NSMutableArray alloc] initWithObjects: + @{@"name":@"Running",@"timer":[[Timer alloc] initWithHours:0 minutes:30]}, + @{@"name":@"Popcorn",@"timer":[[Timer alloc] initWithHours:0 minutes:3]}, + @{@"name":@"Workout",@"timer":[[Timer alloc] initWithHours:1 minutes:30]}, + @{@"name":@"Baked Potato",@"timer":[[Timer alloc] initWithHours:0 minutes:5]}, + @{@"name":@"Presentation Timer",@"timer":[[Timer alloc] initWithHours:0 minutes:3]}, + @{@"name":@"Blueberry Muffins",@"timer":[[Timer alloc] initWithHours:0 minutes:20]}, + @{@"name":@"Pods", @"timer":[[Timer alloc] initWithHours:1 minutes:0]}, + nil]; + +} + + +#pragma mark - Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + + + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + + return [self.presetArrayOfDictionaries count]+1; + +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"presetsCellIdentifier"]; + if(indexPath.row == 0){ + cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"AddNewIdentifier"]; + } + else if (cell == nil){ + cell = [[UITableViewCell alloc ]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"presetsCellIdentifier"]; + } + + if (indexPath.row == 0) { + cell.textLabel.text = @"Add New Preset!"; + //[cell.textLabel setTextColor:[UIColor greenColor]]; + cell.detailTextLabel.text = @"+"; + [cell.detailTextLabel setFont:[UIFont systemFontOfSize:28]]; + [cell.detailTextLabel setTextColor:[UIColor greenColor]]; + + } + else{ + NSDictionary *temp = self.presetArrayOfDictionaries[indexPath.row -1]; + NSString *title = [temp objectForKey:@"name"]; + cell.textLabel.text = title; + //[cell.textLabel setTextColor:[UIColor blackColor]]; + Timer *timer = [temp objectForKey:@"timer"]; + cell.detailTextLabel.text = [[timer timeStringFromTimer]substringToIndex:5]; + + + if (indexPath.row-1>=[self.presetArrayOfDictionaries count]-7) { + [cell.textLabel setTextColor:[UIColor colorWithRed:80.0f/255.0f green:170.0f/255.0f blue:255.0f/255.0f alpha:1.0f]]; + } + else{ + [cell.textLabel setTextColor:[UIColor redColor]]; + } + } + + return cell; +} + + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ + if (indexPath.row!=0) { + NSDictionary * temp = [self.presetArrayOfDictionaries objectAtIndex:indexPath.row -1]; + [self.delegate dictionaryForTimerSelected:temp]; + } + else{ + [self segueToAddingPresetViewController]; + } +} + +-(void)segueToAddingPresetViewController{ + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; + + AddPresetTimerViewController *addingViewController = [storyboard instantiateViewControllerWithIdentifier:@"addPresetViewController"]; + addingViewController.delegate = self; + + [self.navigationController pushViewController:addingViewController animated:YES]; + +} + + +# pragma mark Delegate For Adding Presets View Controller +- (void) newPresetWithName:(NSString *)name timeString:(NSString *)time{ + + NSArray *timeComp = [time componentsSeparatedByString:@":"]; + int hours = [timeComp[0] intValue]; + hours = hours==24? 0: hours; + Timer *newTimer = [[Timer alloc] initWithHours:hours minutes:[timeComp[1] intValue]]; + [self.presetArrayOfDictionaries insertObject:@{ + @"name":name, + @"timer":newTimer + } + atIndex:0]; + [self.tableView reloadData]; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + // Return YES if you want the specified item to be editable. + NSLog(@"%lu",indexPath.row); + if (0 < indexPath.row && indexPath.row <= [self.presetArrayOfDictionaries count]-7) { //&& indexPath.row<[self.presetArrayOfDictionaries count] + + + return YES; + } + + return NO; +} + +// Override to support editing the table view. +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + [self.presetArrayOfDictionaries removeObjectAtIndex:indexPath.row-1]; + [self.tableView reloadData]; + //[self.presetArrayOfDictionaries ] + } +} + + +@end diff --git a/Stopwatch_Timer/SWTimerViewController.h b/Stopwatch_Timer/SWTimerViewController.h new file mode 100644 index 0000000..0c27db5 --- /dev/null +++ b/Stopwatch_Timer/SWTimerViewController.h @@ -0,0 +1,19 @@ +// +// SWTimerViewController.h +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/22/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "Timer.h" +#import +#import +#import "SWTimerTableViewController.h" +#import "SWAudioTableViewController.h" + +@interface SWTimerViewController : UIViewController + +@property (nonatomic) Timer* viewTimer; + +@end diff --git a/Stopwatch_Timer/SWTimerViewController.m b/Stopwatch_Timer/SWTimerViewController.m new file mode 100644 index 0000000..e143925 --- /dev/null +++ b/Stopwatch_Timer/SWTimerViewController.m @@ -0,0 +1,457 @@ +// +// SWTimerViewController.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/22/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "SWTimerViewController.h" +#import "SWTimerTableViewController.h" +#import "KAProgressLabel.h" +#import "LabelAnimator.h" + + +@interface SWTimerViewController () + +@property (weak, nonatomic) IBOutlet UIDatePicker *datePicker; +@property (weak, nonatomic) IBOutlet UIView *datePickerView; +@property (weak, nonatomic) IBOutlet UILabel *timerLabel; +@property (weak, nonatomic) IBOutlet UIButton *pauseButton; +@property (weak, nonatomic) IBOutlet UIButton *startButton; +@property (weak, nonatomic) IBOutlet UIView *timerView; +@property (weak, nonatomic) IBOutlet KAProgressLabel *hoursLabel; +@property (weak, nonatomic) IBOutlet KAProgressLabel *minutesLabel; +@property (weak, nonatomic) IBOutlet KAProgressLabel *secondsLabel; + +@property (weak, nonatomic) IBOutlet UILabel *musicChoiceLabel; +@property (weak, nonatomic) IBOutlet UIView *play_stopView; +@property (weak, nonatomic) IBOutlet UIView *tableView_view; +@property (weak, nonatomic) IBOutlet UIView *musicLabel; +@property (weak, nonatomic) IBOutlet UISegmentedControl *segmentedController; + +@property (nonatomic) NSInteger startButtonState; +@property (nonatomic) NSInteger pauseButtonState; + +@property (nonatomic, strong) NSTimer *countdown_Timer; +@property (nonatomic) double originalTime; + +@property (nonatomic) SWTimerTableViewController *presetsTableView; + +@property (nonatomic) LabelAnimator * animatedLabelsManager; + +@property (nonatomic) AVAudioPlayer* timerPlayer; + + +@end + +@implementation SWTimerViewController + +// In each tabbed view controller +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + if (self = [super initWithCoder:aDecoder]) { + + // non-selected tab bar image + UIImage *defaultImage = [[UIImage imageNamed:@"timer"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; + + // selected tab bar image + UIImage *selectedImage = [[UIImage imageNamed:@"timer"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; + + // set the tab bar item with a title and both images + self.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Timer" image:defaultImage selectedImage:selectedImage]; + return self; + } + return nil; +} + + +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + self.presetsTableView.view.frame = self.tableView_view.bounds; + + // this is not beautiful but its the best of the hack options. + // make sure the content inset (inside padding) is set to 0 all + // the way around + ((UITableView *)self.presetsTableView.view).contentInset = UIEdgeInsetsZero; +} + +- (void)viewDidLoad { + + [super viewDidLoad]; + [self embedTableView]; + [self buttonsDefaultState]; + [self addBorderToButtons]; + self.navigationController.navigationBarHidden = NO; + self.musicLabel.layer.borderColor = [[UIColor blackColor]CGColor]; + self.musicLabel.layer.borderWidth = 1.0f; + self.navigationItem.title = @"Timer"; + self.animatedLabelsManager = [[LabelAnimator alloc] initWithLabels:self.secondsLabel medium:self.minutesLabel large:self.hoursLabel]; + [self.animatedLabelsManager setUpAllPropertyLabels]; + [self defaultAudioFile]; + [self.datePicker addTarget:self action:@selector(changeSegment) forControlEvents:UIControlEventValueChanged]; + + +} + + +-(void) embedTableView{ + UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; + self.presetsTableView = [storyboard instantiateViewControllerWithIdentifier:@"presetsTableView"]; + self.presetsTableView.delegate = self; + [self addChildViewController:self.presetsTableView]; + + self.presetsTableView.view.frame = self.tableView_view.bounds; + [self.tableView_view addSubview:self.presetsTableView.view]; + + [self.presetsTableView willMoveToParentViewController:self]; +} + +- (void)defaultAudioFile{ + NSString* audioString = [NSString stringWithFormat:@"%@/%@.mp3", [[NSBundle mainBundle] resourcePath], @"Warning"]; + + NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: audioString]; + + self.timerPlayer = + [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL + error: nil]; +} + +#pragma mark Button State and Button Content Methods +- (void)buttonsDefaultState{ + + self.startButtonState = -1; + self.pauseButtonState = -1; + +} + +- (void) updateAllButtonStates{ + + self.startButtonState *= -1; + self.pauseButtonState *= -1; +} + +//BORDERS******************* +- (void) addBorderToButtons{ + + self.startButton.layer.borderWidth = 2.0f; + self.startButton.layer.borderColor = [[UIColor blackColor] CGColor]; + + self.pauseButton.layer.borderWidth = 2.0f; + self.pauseButton.layer.borderColor = [[UIColor blackColor] CGColor]; + +} + +//********************** +// Button Content Methods Below + +-(void)startButtonChanges:(UIButton *)button{ + + if(self.startButtonState == 1){ + + [button setTitle:@"+1" forState:UIControlStateNormal]; + + } + + else{ + + [button setTitle:@"Start" forState:UIControlStateNormal]; + [button setTintColor:[UIColor greenColor]]; + + } + +} + + +-(void)pauseButtonChanges:(UIButton *)button{ + + if (self.pauseButtonState == 1) { + + [button setTitle:@"Pause" forState:UIControlStateNormal]; + [button setTintColor:[UIColor redColor]]; + [self.animatedLabelsManager reset]; + + } + else{ + + [button setTitle:@"Cancel" forState:UIControlStateNormal]; + + } + +} +//******************************************************* + +- (IBAction)segmentToggled:(UISegmentedControl *)sender { + + if (self.segmentedController.selectedSegmentIndex == 0){ + + self.tableView_view.hidden = YES; + self.play_stopView.hidden = NO; + + } + else if(self.segmentedController.selectedSegmentIndex == 1) { + + self.tableView_view.hidden = NO; + self.play_stopView.hidden = YES; + + } + +} + +//************************************* + +- (IBAction)pauseButton:(UIButton *)sender { + + if(self.pauseButtonState == -1){ + + //Cancelling + [self reset]; + self.datePickerView.hidden=NO; + self.originalTime = 0; + + } + else{ + //Paused Triggered + [self invalidateTimer]; + + [self updateAllButtonStates]; + [self startButtonChanges:self.startButton]; + [self pauseButtonChanges:sender]; + + } + + +} + +- (IBAction)startTimerButton:(UIButton *)sender { + + if(self.startButtonState == -1){ + + //If there is no timer object then read in the date picker + [self countdownBegins]; + } + else{ + self.viewTimer.secondsForTimer +=60; + self.originalTime += 60; + [self updateTimerLabel]; + } + +} + +//**************************************************** + +#pragma mark Reading Date Picker +- (void) readDatePicker{ + + NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; + [outputFormatter setDateFormat:@"k:mm"]; + NSString *time = [outputFormatter stringFromDate:self.datePicker.date]; + + self.timerLabel.text = [NSString stringWithFormat:@"%@:00", time]; + [self timerFromTimeString:(NSString*)time]; + + self.datePickerView.hidden = YES; + + +} + +- (void)changeSegment{ + + if ([self.segmentedController selectedSegmentIndex] !=0) { + self.segmentedController.selectedSegmentIndex=0; + [self segmentToggled:self.segmentedController]; + } +} +//BEGIN COUNTDOWN +- (void) countdownBegins{ + + if(!self.viewTimer){ + [self readDatePicker]; + + } + + //Change all buttons and update States + [self updateAllButtonStates]; + [self startButtonChanges:self.startButton]; + [self pauseButtonChanges:self.pauseButton]; + [self updateTimerLabel]; + + //Set up NSTimer + [self.animatedLabelsManager reset]; + [self setUpTimer]; + self.datePickerView.hidden = YES; +} + +//************************************************* + +#pragma mark Timer Object + +- (void) timerFromTimeString:(NSString *)time{ + + NSArray *components = [time componentsSeparatedByString:@":"]; + int hour = [components[0] intValue]; + hour = hour!=24? hour: 0; + int min = [components[1] intValue]; + + self.viewTimer = [[Timer alloc] initWithHours:hour minutes:min]; + self.originalTime = self.viewTimer.secondsForTimer; +} + +//Timer Label +- (void) updateTimerLabel{ + + self.timerLabel.text = [self.viewTimer timeStringFromTimer]; + +} + +//***************** +#pragma mark Setting up NSTimer and Selector + +- (void)setUpTimer{ + + self.countdown_Timer = [[NSTimer alloc]initWithFireDate:self.datePicker.date interval: 0.04f target:self selector:@selector(fireCountdownTimer) userInfo:nil repeats:YES]; + + [[NSRunLoop mainRunLoop] addTimer:self.countdown_Timer forMode:NSRunLoopCommonModes]; + +} + + +- (void) fireCountdownTimer{ + + self.viewTimer.secondsForTimer -=.04; + + if (self.viewTimer.secondsForTimer <=0.0) { + [self.animatedLabelsManager.smallLabel setProgress:0.0]; + [self invalidateTimer]; + self.timerLabel.text = @"00:00:00"; + [self.timerPlayer play]; + [self deployAlertView]; + //[self reset]; + + } + else{ + + [self updateTimerLabel]; + [self.animatedLabelsManager updateWithOriginal:self.originalTime new:self.viewTimer.secondsForTimer]; + } +} + +//************************************* + +# pragma Reset Methods + +- (void)reset{ + [self invalidateTimer]; + self.viewTimer = nil; + +} + + +- (void) invalidateTimer{ + + if(self.countdown_Timer!=nil){ + + [self.countdown_Timer invalidate]; + self.countdown_Timer = nil; + + } +} +//************************************* +#pragma UIAlertView Implementation and Delegate methods +-(void) deployAlertView{ + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Done!!" message:@"Time's up!" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles: nil]; + alert.delegate = self; + [alert show]; + +} + + +- (void) alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex{ + NSLog(@"logging"); + if ([self.timerPlayer isPlaying]){ + [self.timerPlayer stop]; + } + [self reset]; + [self buttonsDefaultState]; + [self startButtonChanges:self.startButton]; + [self pauseButtonChanges:self.pauseButton]; + self.originalTime = 0; + self.datePickerView.hidden = NO; +} + +//************************************* + +#pragma mark Playing and Stopping Audio Player + +- (IBAction)playAudioButtonSelected:(UIButton *)sender { + + NSLog(@"audio play, audio stop?"); + if([self.timerPlayer isPlaying]){ + [self.timerPlayer stop]; + + } + else{ + + NSTimer *timer = [NSTimer timerWithTimeInterval:2.0f target:self selector:@selector(stopPlaying:) userInfo:nil repeats:NO]; + [self.timerPlayer play]; + [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; + + } +} + +- (void) stopPlaying:(NSTimer *)timer{ + [timer invalidate]; + timer = nil; + if ([self.timerPlayer isPlaying]){ + [self.timerPlayer stop]; + } +} +//************************************** + +#pragma mark + +- (void) dictionaryForTimerSelected:(NSDictionary *)dictionary{ + + [self reset]; + self.segmentedController.selectedSegmentIndex=0; + [self segmentToggled:self.segmentedController]; + + self.viewTimer = [[Timer alloc]initWithTimer:[dictionary objectForKey:@"timer"]]; + self.originalTime = self.viewTimer.secondsForTimer; + self.navigationItem.title = [dictionary objectForKey:@"name"]; + [self buttonsDefaultState]; + [self countdownBegins]; +} + + +#pragma mark and Transition to SWAudioTableViewContoller + +-(void)didSelectAudioFilename:(NSString*)string { + + NSString* audioString = [NSString stringWithFormat:@"%@/%@.mp3", [[NSBundle mainBundle] resourcePath], string]; + + NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: audioString]; + + self.timerPlayer = + [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL + error: nil]; + self.musicChoiceLabel.text = string; + + +} + +//************************************************ + +#pragma mark Transition to SWAudioTableViewController + +-(IBAction)audioButton:(UIButton*)sender { + SWAudioTableViewController *audioTable = [self.storyboard instantiateViewControllerWithIdentifier:@"AudioTable"]; + audioTable.delegate = self; + audioTable.oldSelection = self.musicChoiceLabel.text; + [self.navigationController pushViewController:audioTable animated:YES]; + +} + +// + + +@end diff --git a/Stopwatch_Timer/SWViewController.h b/Stopwatch_Timer/SWViewController.h new file mode 100644 index 0000000..1e53fbc --- /dev/null +++ b/Stopwatch_Timer/SWViewController.h @@ -0,0 +1,13 @@ +// +// SWViewController.h +// Stopwatch_Timer +// +// Created by Jackie Meggesto on 8/21/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import + +@interface SWViewController : UIViewController + +@end diff --git a/Stopwatch_Timer/SWViewController.m b/Stopwatch_Timer/SWViewController.m new file mode 100644 index 0000000..a5faaea --- /dev/null +++ b/Stopwatch_Timer/SWViewController.m @@ -0,0 +1,225 @@ +// +// SWViewController.m +// Stopwatch_Timer +// +// Created by Jackie Meggesto on 8/21/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + + + +#import "SWViewController.h" +#import +#import "SWTableViewController.h" + + +CFTimeInterval const frameInterval = 1.0/60.0f; + +@interface SWViewController () +@property (nonatomic) CADisplayLink* stopwatchDisplayLink; +@property (nonatomic) NSString* lapTimerText; +@property (nonatomic, weak) IBOutlet UILabel* runningTimerLabel; +@property (nonatomic) CFTimeInterval startTime; +@property (nonatomic) CFTimeInterval runningTimerValue; +@property (weak, nonatomic) IBOutlet UIView *tableViewSpace; +@property (nonatomic,strong) SWTableViewController *lapTableView; +@property (weak, nonatomic) IBOutlet UIButton *startButton; +@property (weak, nonatomic) IBOutlet UIButton *lapButton; +@property (nonatomic) int startButtonState; +@property (nonatomic) int lapButtonState; +@property (nonatomic) CFTimeInterval lapTimerRef; + + +@end + +@implementation SWViewController + +// In each tabbed view controller +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + if (self = [super initWithCoder:aDecoder]) { + + // non-selected tab bar image + UIImage *defaultImage = [[UIImage imageNamed:@"stopwatch"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; + + // selected tab bar image + UIImage *selectedImage = [[UIImage imageNamed:@"stopwatch"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; + + // set the tab bar item with a title and both images + self.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Stopwatch" image:defaultImage selectedImage:selectedImage]; + return self; + } + return nil; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self setUpButtons]; + + [self embedTableViewController]; + + self.navigationItem.title = @"Stopwatch"; +} + +-(void)setUpButtons{ + self.runningTimerValue = 0.0f; + self.startButtonState = -1; + self.lapTimerRef = 0.0f; + self.lapButtonState = -1; + self.lapButton.enabled = NO; +} + +-(void)setUpStopwatchLink { + self.stopwatchDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(fireStopwatchDisplayLink)]; + [self.stopwatchDisplayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; + +} +-(void)fireStopwatchDisplayLink { + + self.runningTimerValue += frameInterval; +// self.runningTimerLabel.text = [NSString stringWithFormat:@"%.2lf", self.runningTimerValue]; +// + self.runningTimerLabel.text = [self timeFormattedWithValue:self.runningTimerValue]; + + +} +-(NSString*)timeFormattedWithValue:(double)value { + + double time = value; + int hours = 3600; + + + + + + int HH = time / hours; + + + time = time - (3600 * HH); + int MM = time / 60; + time = time - 60 * MM; + int SS = floor(time); + int mm = (time - SS) * 100; + if (mm <= 9) { + return [NSString stringWithFormat:@"%.2d:%.2d:%.2d:0%d", HH, MM, SS, mm]; + } + + return [NSString stringWithFormat:@"%.2d:%.2d:%.2d:%d", HH, MM, SS, mm]; + +} + + +-(IBAction)startWatch:(id)sender { + switch (self.startButtonState) { + case -1: + [self startButtonSelected]; + + break; + case 1: + [self stopButtonSelected]; + break; + default: + break; + } + +// self.startTime = CACurrentMediaTime(); +// [self.stopwatchDisplayLink invalidate]; +// [self setUpStopwatchLink]; +} +-(IBAction)lapButton:(id)sender { + switch (self.lapButtonState) { + case -1: + [self lapButtonSelected]; + break; + case 1: + [self resetButtonSelected]; + break; + default: + break; + } +// self.stopwatchDisplayLink.paused = YES; + +} + +#pragma mark ActionsForStates + +//START/STOP +-(void)startButtonSelected { + [self.startButton setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; + [self.startButton setTitle:@"Stop" forState:UIControlStateNormal]; + + [self.lapButton setTitle:@"Lap" forState:UIControlStateNormal]; + self.lapButton.enabled = YES; + + if (self.stopwatchDisplayLink == nil) { + [self setUpStopwatchLink]; + } else { + self.stopwatchDisplayLink.paused = NO; + } + self.startTime = CACurrentMediaTime(); + + self.lapButtonState = -1; + self.startButtonState *= -1; +} +//************ + +-(void)stopButtonSelected { + + [self.startButton setTitleColor:[UIColor greenColor] forState:UIControlStateNormal]; + + [self.startButton setTitle:@"Start" forState:UIControlStateNormal]; + + [self.lapButton setTitle:@"Reset" forState:UIControlStateNormal]; + self.lapButtonState *= -1; + self.startButtonState *= -1; + self.stopwatchDisplayLink.paused = YES; + self.lapTimerRef = [self.lapTimerText doubleValue]; + +} + +//*************************************** + +- (void) lapButtonSelected{ + + double timeElapse = [self.stopwatchDisplayLink timestamp] - self.startTime; + + [self.lapTableView.lapTimesArray insertObject:[NSString stringWithFormat:@"%.2lf", self.lapTimerRef + timeElapse] atIndex:0]; + + [self.lapTableView.tableView reloadData]; + self.lapTimerRef = 0.0f; + self.startTime = CACurrentMediaTime(); + [self.stopwatchDisplayLink invalidate]; + [self setUpStopwatchLink]; + + + + +} + +- (void) resetButtonSelected{ + + [self setUpButtons]; + self.runningTimerLabel.text = @"00:00:00:00"; + + [self.lapTableView.lapTimesArray removeAllObjects]; + [self.lapTableView.tableView reloadData]; + +} + +#pragma mark Embedding +//EMBEDDING METHOD +- (void) embedTableViewController{ + + self.lapTableView = [self.storyboard instantiateViewControllerWithIdentifier:@"LapTableViewCtrlIdentifier"]; + + [self addChildViewController:self.lapTableView]; + + self.lapTableView.view.frame = self.tableViewSpace.bounds; + [self.tableViewSpace addSubview:self.lapTableView.view]; + [self.lapTableView willMoveToParentViewController:self]; + +} + +//*************************************** + +@end diff --git a/Stopwatch_Timer/ShortAlarm.mp3 b/Stopwatch_Timer/ShortAlarm.mp3 new file mode 100644 index 0000000..4e3b39d Binary files /dev/null and b/Stopwatch_Timer/ShortAlarm.mp3 differ diff --git a/Stopwatch_Timer/SpecialEvent.h b/Stopwatch_Timer/SpecialEvent.h new file mode 100644 index 0000000..5e17312 --- /dev/null +++ b/Stopwatch_Timer/SpecialEvent.h @@ -0,0 +1,16 @@ +// +// SpecialEvent.h +// Stopwatch_Timer +// +// Created by Jackie Meggesto on 8/27/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import + +@interface SpecialEvent : NSObject + +@property (nonatomic) NSString* name; +@property (nonatomic) NSTimeInterval time; +@property (nonatomic) NSMutableArray *memos; +@end diff --git a/Stopwatch_Timer/SpecialEvent.m b/Stopwatch_Timer/SpecialEvent.m new file mode 100644 index 0000000..b7273c4 --- /dev/null +++ b/Stopwatch_Timer/SpecialEvent.m @@ -0,0 +1,15 @@ +// +// SpecialEvent.m +// Stopwatch_Timer +// +// Created by Jackie Meggesto on 8/27/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "SpecialEvent.h" + +@implementation SpecialEvent + + + +@end diff --git a/Stopwatch_Timer/Timer.h b/Stopwatch_Timer/Timer.h new file mode 100644 index 0000000..9f778d1 --- /dev/null +++ b/Stopwatch_Timer/Timer.h @@ -0,0 +1,19 @@ +// +// Timer.h +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/22/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import + +@interface Timer : NSObject + +@property (nonatomic) double secondsForTimer; + +- (instancetype) initWithHours:(int)hours minutes:(int)minutes; +- (instancetype) initWithTimer:(Timer *)timer; +- (NSString *)timeStringFromTimer; + +@end diff --git a/Stopwatch_Timer/Timer.m b/Stopwatch_Timer/Timer.m new file mode 100644 index 0000000..04c9713 --- /dev/null +++ b/Stopwatch_Timer/Timer.m @@ -0,0 +1,55 @@ +// +// Timer.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/22/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import "Timer.h" + +@implementation Timer + +- (instancetype) initWithHours:(int)hours minutes:(int)minutes{ + + if (self = [super init]) { + + double hour_sec = 3600*hours; + double minutes_sec = 60*minutes; + self.secondsForTimer = hour_sec + minutes_sec; + + return self; + } + return nil; +} + + +- (instancetype) initWithTimer:(Timer *)timer{ + + if (self = [super init]) { + + self.secondsForTimer = timer.secondsForTimer; + + return self; + } + return nil; +} + + + +- (NSString *)timeStringFromTimer{ + + double time = self.secondsForTimer; + int HH = time/ 3600; + + time = time - (3600 * HH); + int MM = time / 60; + time = time - 60 * MM; + int SS = floor(time); + + return [NSString stringWithFormat:@"%.2d:%.2d:%.2d", HH, MM, SS]; + + +} + +@end diff --git a/Stopwatch_Timer/Warning.mp3 b/Stopwatch_Timer/Warning.mp3 new file mode 100644 index 0000000..4a669b0 Binary files /dev/null and b/Stopwatch_Timer/Warning.mp3 differ diff --git a/Stopwatch_Timer/main.m b/Stopwatch_Timer/main.m new file mode 100644 index 0000000..32a791f --- /dev/null +++ b/Stopwatch_Timer/main.m @@ -0,0 +1,16 @@ +// +// main.m +// Stopwatch_Timer +// +// Created by Varindra Hart on 8/21/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/Stopwatch_TimerTests/Info.plist b/Stopwatch_TimerTests/Info.plist new file mode 100644 index 0000000..b664b7e --- /dev/null +++ b/Stopwatch_TimerTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + nyc.c4q.vhart.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/Stopwatch_TimerTests/Stopwatch_TimerTests.m b/Stopwatch_TimerTests/Stopwatch_TimerTests.m new file mode 100644 index 0000000..ecd2583 --- /dev/null +++ b/Stopwatch_TimerTests/Stopwatch_TimerTests.m @@ -0,0 +1,40 @@ +// +// Stopwatch_TimerTests.m +// Stopwatch_TimerTests +// +// Created by Varindra Hart on 8/21/15. +// Copyright (c) 2015 Varindra Hart. All rights reserved. +// + +#import +#import + +@interface Stopwatch_TimerTests : XCTestCase + +@end + +@implementation Stopwatch_TimerTests + +- (void)setUp { + [super setUp]; + // Put setup code here. This method is called before the invocation of each test method in the class. +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testExample { + // This is an example of a functional test case. + XCTAssert(YES, @"Pass"); +} + +- (void)testPerformanceExample { + // This is an example of a performance test case. + [self measureBlock:^{ + // Put the code you want to measure the time of here. + }]; +} + +@end