Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
471 changes: 471 additions & 0 deletions Time/StopWatch.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Time/Time/AppDelegate.h → Time/StopWatch/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// AppDelegate.h
// Time
// StopWatch
//
// Created by Michael Kavouras on 8/20/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
// Created by MacMan on 8/20/15.
// Copyright (c) 2015 MacManApp. All rights reserved.
//

#import <UIKit/UIKit.h>
Expand Down
13 changes: 8 additions & 5 deletions Time/Time/AppDelegate.m → Time/StopWatch/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// AppDelegate.m
// Time
// StopWatch
//
// Created by Michael Kavouras on 8/20/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
// Created by MacMan on 8/20/15.
// Copyright (c) 2015 MacManApp. All rights reserved.
//

#import "AppDelegate.h"
Expand All @@ -14,8 +14,11 @@ @interface AppDelegate ()

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)]){
[application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound categories:nil]];
}
// Override point for customization after application launch.
return YES;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Mike Kavouras. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 MacManApp. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Time" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="StopWatch" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
Expand Down
648 changes: 648 additions & 0 deletions Time/StopWatch/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions Time/StopWatch/Event.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// eventObject.h
// StopWatch
//
// Created by Natalia Estrella on 8/29/15.
// Copyright (c) 2015 MacManApp. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Event : NSObject
@property (nonatomic) NSString *name;
@property (nonatomic) NSDate *endTime;
@property (nonatomic) NSString *pictureName;

@end
13 changes: 13 additions & 0 deletions Time/StopWatch/Event.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// eventObject.m
// StopWatch
//
// Created by Natalia Estrella on 8/29/15.
// Copyright (c) 2015 MacManApp. All rights reserved.
//

#import "Event.h"

@implementation Event

@end
17 changes: 17 additions & 0 deletions Time/StopWatch/EventCountdownViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// EventCountdownViewController.h
// StopWatch
//
// Created by Natalia Estrella on 8/29/15.
// Copyright (c) 2015 MacManApp. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Event.h"

@interface EventCountdownViewController : UIViewController

@property (nonatomic) Event *event;
@property (nonatomic) NSDateFormatter *dateFormatter;

@end
73 changes: 73 additions & 0 deletions Time/StopWatch/EventCountdownViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
//
// EventCountdownViewController.m
// StopWatch
//
// Created by Natalia Estrella on 8/29/15.
// Copyright (c) 2015 MacManApp. All rights reserved.
//

#import "EventCountdownViewController.h"

@interface EventCountdownViewController ()

@property (weak, nonatomic) IBOutlet UILabel *countdownLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIImageView *emojiImage;

@end

@implementation EventCountdownViewController

- (void)viewDidLoad {
[super viewDidLoad];
self.nameLabel.text = [self.event name];
self.emojiImage.image = [UIImage imageNamed:[self.event pictureName]];



// create a new instance of NSTimer
// equivalent of running [self timerFired] every 1.0 seconds
NSTimer *timer = [NSTimer timerWithTimeInterval:0.1 target:self selector:@selector(timerFired:) userInfo:nil repeats:YES];

// make sure we add the new timer to the run loop so that it
// executes
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSDefaultRunLoopMode];

}

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}


- (void)timerFired:(NSTimer *)timer {

NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];

NSCalendarUnit unitFlag = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond;


NSDate *fromDate = [NSDate date];
NSDate *toDate = self.event.endTime;

NSDateComponents *components = [calendar components:unitFlag
fromDate:[NSDate date]
toDate:self.event.endTime
options:0];

self.countdownLabel.text = [NSString stringWithFormat:@"Years:%@ Months:%@ Days:%@\nHours:%@ Minuets:%@ Seconds:%@ ", @(components.year), @(components.month), @(components.day), @(components.hour), @(components.minute), @(components.second)];

// if ([fromDate timeIntervalSinceDate:toDate] ) {
//
// }
//

if ([fromDate earlierDate:toDate] == toDate ) {
[timer invalidate];
self.countdownLabel.text = @"You're all set";

}
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "83.5x83.5",
"scale" : "2x"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "ios_emoji_skull.png"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "olive-toned-baby-angel.png"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Time/StopWatch/Images.xcassets/runner_imoji.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "runner_imoji.jpeg"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Time/Time/Info.plist → Time/StopWatch/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.mikekavouras.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>com.buleApp.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
17 changes: 17 additions & 0 deletions Time/StopWatch/SpecialEventsTableViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// SpecialEventsTableViewController.h
// StopWatch
//
// Created by Natalia Estrella on 8/29/15.
// Copyright (c) 2015 MacManApp. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface SpecialEventsTableViewController : UITableViewController
@property (nonatomic) NSMutableArray *specialEventsList;




@end
Loading