Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project #9

Open
wants to merge 73 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
88a3778
had to fork repo
Aug 23, 2015
bdc283d
first commit
Aug 23, 2015
bada12c
trying to fix storyboard
Aug 23, 2015
189a87d
improved wiring
bereket6725 Aug 23, 2015
234ccff
test commit
bereket6725 Aug 23, 2015
01bb778
changed to self.timer
Aug 23, 2015
2d5928b
proving i'm right
Aug 23, 2015
e304b00
yo duuude
bereket6725 Aug 23, 2015
7be4bb7
made a moo
bereket6725 Aug 23, 2015
6aa25d9
vhart helped me get the timer to work. need to make sure it counts f…
Aug 23, 2015
bf078a0
changes
Aug 24, 2015
28863a4
fixed storyboard
Aug 25, 2015
3303760
fixed some code in the .h
Aug 25, 2015
dd0a06e
trying to get nsdate and uidatepicker hooked up
Aug 26, 2015
c9bca30
adding new folders
Aug 26, 2015
aa559a2
added two files
bereket6725 Aug 26, 2015
d9e7b5a
working in view controller
Aug 26, 2015
29fcc41
merge conflict resolved
Aug 26, 2015
63eb5ce
timer finally counts down rather than up
Aug 27, 2015
50d4525
added more tableviewcontrollers as well as delegates
Aug 27, 2015
fd96c8d
going to implement segues for preset timers at a later point
Aug 27, 2015
ae2ba72
trying to create preset timer
Aug 27, 2015
1733ac3
i don't know what i'm doing
Aug 27, 2015
bf29437
mike fixed the .main problem god bless
Aug 28, 2015
1dde279
can now go back and forth between view controllers for countdown
Aug 28, 2015
d7f7aff
working on events timer countdown
Aug 28, 2015
34006aa
countdown works
Aug 29, 2015
9a86c27
time counts down better
Aug 29, 2015
b47b5ed
multiple countdown timers working, also working on UI
Aug 29, 2015
902e499
all three events timers working as intended
Aug 29, 2015
bb6e88f
still working on ui
Aug 30, 2015
09d205a
making rounded views for start button
Aug 30, 2015
1d69667
added app icon
Aug 30, 2015
c3a3247
ui trying to mak circles
Aug 31, 2015
e450269
deleted some stuff
Aug 31, 2015
34fc1e3
working in storyboard keep me updated bereket
Sep 1, 2015
2290c2b
not enough time to refactor code to make it the way i want. going to …
Sep 1, 2015
17bad83
working in storyboard
Sep 1, 2015
d96606a
timer UI is done
Sep 1, 2015
3b69b34
events countdown UI nearly done
Sep 1, 2015
65cff4d
events countdown UI nearly done, need to polish as well as the timer …
Sep 1, 2015
2f84391
made changes
bereket6725 Sep 1, 2015
b39ad2d
just added 1 comment, nothing changed
Sep 1, 2015
d6bd8f4
no changes made
Sep 1, 2015
91cf5c3
made stopWatch improvements
bereket6725 Sep 1, 2015
deb8f23
quick changes to events countdown
Sep 1, 2015
da1752b
ww
Sep 1, 2015
140629a
one error left
bereket6725 Sep 1, 2015
14d3650
made changes
bereket6725 Sep 1, 2015
1e4a024
fixed the cell bug
bereket6725 Sep 1, 2015
0e9a418
laps are working
Sep 1, 2015
3621185
added comment in stopwatchviewcontroller.h
Sep 2, 2015
23a8cba
added another comment this should work'
Sep 2, 2015
70ecd40
I hate you, burn in hell
bereket6725 Sep 2, 2015
f081538
UI changes and trying to get stop button to appear in the events coun…
Sep 2, 2015
a72e46f
UI changes
Sep 2, 2015
debc7ad
added preset timer views
Sep 2, 2015
c7d2968
all UI is done, bereket you're up mang
Sep 2, 2015
baf27f3
UI is actually done
Sep 2, 2015
e100523
commit
Sep 2, 2015
05c7013
almost done
bereket6725 Sep 3, 2015
fb27219
fixed some bugs but needs a few more tweaks
bereket6725 Sep 3, 2015
8f3a1c5
getting closer
bereket6725 Sep 3, 2015
e705126
-___-
bereket6725 Sep 3, 2015
09c1bb5
added some code for pause timer but its still broken
bereket6725 Sep 3, 2015
7ae9bd3
fixed pause button and have a timer going down but the format is weird
bereket6725 Sep 3, 2015
9a76226
more changes getting closer
bereket6725 Sep 3, 2015
62195aa
made some changes
bereket6725 Sep 3, 2015
9f22329
it's okay bereket
Sep 3, 2015
e0d76e0
SHIIIIIIIIT
Sep 3, 2015
a5d81d1
WE DONE BOYS
Sep 3, 2015
f6456f0
fml
Sep 3, 2015
ccd4046
wanted a challenge so i deleted the storyboard
Sep 4, 2015
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
433 changes: 0 additions & 433 deletions Time/Time.xcodeproj/project.pbxproj

This file was deleted.

25 changes: 0 additions & 25 deletions Time/Time/Base.lproj/Main.storyboard

This file was deleted.

15 changes: 0 additions & 15 deletions Time/Time/ViewController.h

This file was deleted.

27 changes: 0 additions & 27 deletions Time/Time/ViewController.m

This file was deleted.

557 changes: 557 additions & 0 deletions Time/TimerStopwatch.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/TimerStopwatch/AppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//
// AppDelegate.h
// Time
// TimerStopwatch
//
// Created by Michael Kavouras on 8/20/15.
// Copyright (c) 2015 Mike Kavouras. All rights reserved.
// Created by Charles Kang on 8/22/15.
// Copyright (c) 2015 Charles Kang . All rights reserved.
//

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

#import "AppDelegate.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="8173.3" systemVersion="14E46" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8142"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
Expand All @@ -11,16 +11,16 @@
<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 Charles Kang . 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"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<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="TimerStopwatch" 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"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
Expand Down
18 changes: 18 additions & 0 deletions Time/TimerStopwatch/EventsCountdownViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// EventsCountdownViewController.h
// TimerStopwatch
//
// Created by Charles Kang on 8/27/15.
// Copyright (c) 2015 Charles Kang . All rights reserved.
//

#import <UIKit/UIKit.h>

@interface EventsCountdownViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIButton *birthdayStartButton;
@property (strong, nonatomic) IBOutlet UIButton *christmasStartButton;
@property (strong, nonatomic) IBOutlet UIButton *ACStartButton;

@property (strong, nonatomic) IBOutlet UIButton *stopBirthdayLabelButton;

@end
160 changes: 160 additions & 0 deletions Time/TimerStopwatch/EventsCountdownViewController.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
//
// EventsCountdownViewController.m
// TimerStopwatch
//
// Created by Charles Kang on 8/27/15.
// Copyright (c) 2015 Charles Kang . All rights reserved.
//

#import "EventsCountdownViewController.h"
#import "TimerViewController.h"

@interface EventsCountdownViewController ()

@property (strong, nonatomic) IBOutlet UIDatePicker *datePicker;

@property (strong, nonatomic) IBOutlet UILabel *birthdayCountdownLabel;
@property (strong, nonatomic) IBOutlet UILabel *christmasCountdownLabel;
@property (strong, nonatomic) IBOutlet UILabel *accessCodeCountdownLabel;

@property (nonatomic) NSDate *birthday;
@property (nonatomic) NSDate *christmas;
@property (nonatomic) NSDate *accessCode;

@end

@implementation EventsCountdownViewController

- (void)viewDidLoad {
[super viewDidLoad];

[self.birthdayCountdownLabel setHidden:YES];
[self.christmasCountdownLabel setHidden:YES];
[self.accessCodeCountdownLabel setHidden:YES];

[self.stopBirthdayLabelButton setHidden:YES];

self.birthdayStartButton.layer.borderWidth = 2.0;
self.birthdayStartButton.layer.cornerRadius = 11.0;
self.birthdayStartButton.layer.borderColor = [UIColor colorWithRed:32/255.0 green:44/255.0 blue:49/255.0 alpha: 1].CGColor;
[self.birthdayStartButton setClipsToBounds:YES];

self.christmasStartButton.layer.borderWidth = 2.0;
self.christmasStartButton.layer.cornerRadius = 11.0;
self.christmasStartButton.layer.borderColor = [UIColor colorWithRed:32/255.0 green:44/255.0 blue:49/255.0 alpha: 1].CGColor;[self.christmasStartButton setClipsToBounds:YES];

self.ACStartButton.layer.borderWidth = 2.0;
self.ACStartButton.layer.cornerRadius = 11.0;
self.ACStartButton.layer.borderColor = [UIColor colorWithRed:32/255.0 green:44/255.0 blue:49/255.0 alpha: 1].CGColor;
[self.ACStartButton setClipsToBounds:YES];
}

- (IBAction)startBirthdayCountdown:(id)sender {

[self.birthdayCountdownLabel setHidden:NO];
[self.birthdayStartButton setHidden:YES];
[self.stopBirthdayLabelButton setHidden:NO];

NSDateFormatter *birthdayFormatter = [[NSDateFormatter alloc] init];
[birthdayFormatter setDateFormat:@"yyy-MM-dd"];
self.birthday = [birthdayFormatter dateFromString:@"2016-02-21"];
[birthdayFormatter setDateStyle:NSDateFormatterLongStyle];
[birthdayFormatter setTimeStyle:NSDateFormatterLongStyle];

[self.datePicker setDate:self.birthday animated:NO];

NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
NSUInteger preservedComponents = (NSCalendarUnitYear | NSCalendarUnitDay | NSCalendarUnitDay);
self.datePicker.date = self.birthday;
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateBirthdayTime) userInfo:nil repeats:YES];
}

- (IBAction)startChristmasCountdown:(id)sender {

[self.christmasCountdownLabel setHidden:NO];
[self.christmasStartButton setHidden:YES];

NSDateFormatter *christmasFormatter = [[NSDateFormatter alloc] init];
[christmasFormatter setDateFormat:@"yyy-MM-dd"];
self.christmas = [christmasFormatter dateFromString:@"2015-12-25"];
[christmasFormatter setDateStyle:NSDateFormatterLongStyle];
[christmasFormatter setTimeStyle:NSDateFormatterLongStyle];

[self.datePicker setDate:self.christmas animated:NO];

NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
NSUInteger preservedComponents = (NSCalendarUnitYear | NSCalendarUnitDay | NSCalendarUnitDay);
self.datePicker.date = self.christmas;
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateChristmasTime) userInfo:nil repeats:YES];
}

- (IBAction)startACCountdown:(id)sender {

[self.accessCodeCountdownLabel setHidden:NO];
[self.ACStartButton setHidden:YES];

NSDateFormatter *accessCodeFormatter = [[NSDateFormatter alloc] init];
[accessCodeFormatter setDateFormat:@"yyy-MM-dd"];
self.accessCode = [accessCodeFormatter dateFromString:@"2016-02-28"];
[accessCodeFormatter setDateStyle:NSDateFormatterLongStyle];
[accessCodeFormatter setTimeStyle:NSDateFormatterLongStyle];

[self.datePicker setDate:self.accessCode animated:NO];

NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
NSUInteger preservedComponents = (NSCalendarUnitYear | NSCalendarUnitDay | NSCalendarUnitDay);
self.datePicker.date = self.accessCode;
[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateAccessCodeTime) userInfo:nil repeats:YES];
}

-(void)updateBirthdayTime

{
NSInteger time = ((NSInteger)[self.birthday timeIntervalSinceNow]);
NSInteger seconds = time % 60;
NSInteger minutes = (time / 60) % 60;
NSInteger hours = (time / 3600) % 24;
NSInteger days = (time / 86400);

NSLog(@"%ld", (long)time);
NSLog(@"%ld, %ld, %ld, %ld", days, hours, minutes, seconds);
NSString *timeDisplay = [[NSString alloc] initWithFormat:@"%02ldd: %02ldh: %02ldm: %02lds", (long)days, (long)hours, (long)minutes, (long) seconds];

self.birthdayCountdownLabel.text = timeDisplay;
}

-(void)updateChristmasTime

{
NSInteger time = ((NSInteger)[self.christmas timeIntervalSinceNow]);
NSInteger seconds = time % 60;
NSInteger minutes = (time / 60) % 60;
NSInteger hours = (time / 3600) % 24;
NSInteger days = (time / 86400);

NSLog(@"%ld", (long)time);
NSLog(@"%ld, %ld, %ld, %ld", days, hours, minutes, seconds);
NSString *timeDisplay = [[NSString alloc] initWithFormat:@"%02ldd: %02ldh: %02ldm: %02lds", (long)days, (long)hours, (long)minutes, (long) seconds];

self.christmasCountdownLabel.text = timeDisplay;
}

-(void)updateAccessCodeTime

{
NSInteger time = ((NSInteger)[self.accessCode timeIntervalSinceNow]);
NSInteger seconds = time % 60;
NSInteger minutes = (time / 60) % 60;
NSInteger hours = (time / 3600) % 24;
NSInteger days = (time / 86400);

NSLog(@"%ld", (long)time);
NSLog(@"%ld, %ld, %ld, %ld", days, hours, minutes, seconds);
NSString *timeDisplay = [[NSString alloc] initWithFormat:@"%02ldd: %02ldh: %02ldm: %02lds", (long)days, (long)hours, (long)minutes, (long) seconds];

self.accessCodeCountdownLabel.text = timeDisplay;
}
- (IBAction)stopBirthdayLabel:(id)sender {
}

@end
Binary file added Time/TimerStopwatch/Gravity-Book.ttf
Binary file not shown.
Binary file added Time/TimerStopwatch/Gravity-Light.ttf
Binary file not shown.
Binary file added Time/TimerStopwatch/HYPE.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,27 @@
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Time/TimerStopwatch/Images.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
12 changes: 12 additions & 0 deletions Time/TimerStopwatch/Images.xcassets/Image.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "Image.png"
}
],
"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" : "clock-alarm-7.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.
Loading