Skip to content

Commit 9ffca4a

Browse files
updated watch app dates
1 parent 85f07bb commit 9ffca4a

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

try! Extension/ComplicationController.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ import Foundation
1212

1313
class ComplicationController: NSObject, CLKComplicationDataSource {
1414

15-
fileprivate let conferenceStartDate = Date.date(year: 2017, month: 11, day: 18, hour: 0, minute: 0, second: 0)
15+
fileprivate let conferenceStartDate = Date.date(year: 2018, month: 3, day: 1, hour: 0, minute: 0, second: 0)
16+
fileprivate let headerText = "try! Tokyo"
17+
fileprivate let bodyText = "🇯🇵🐥🎉"
1618

1719
fileprivate let sessionBlocks: [SessionBlock] = {
1820
let days = ConferenceDay.all
19-
let conferenceDays = [days[0]]
21+
let conferenceDays = [days[0], days[1], days[2]]
2022
let sessionBlocks = conferenceDays.flatMap { $0.sessionBlocks }
2123
return sessionBlocks
2224
}()
@@ -58,8 +60,8 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
5860

5961
if currentDate < conferenceStartDate {
6062
let tmpl = CLKComplicationTemplateModularLargeStandardBody()
61-
tmpl.headerTextProvider = CLKSimpleTextProvider(text: "try! India")
62-
tmpl.body1TextProvider = CLKSimpleTextProvider(text: "🇮🇳🐥🎉")
63+
tmpl.headerTextProvider = CLKSimpleTextProvider(text: headerText)
64+
tmpl.body1TextProvider = CLKSimpleTextProvider(text: bodyText)
6365
let startDate = firstSession.startTime
6466
let style = CLKRelativeDateStyle.natural
6567
let units: NSCalendar.Unit = [.day, .hour, .minute]
@@ -70,8 +72,8 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
7072
} else if currentDate > lastSession.endTime as Date {
7173
let tmpl = CLKComplicationTemplateModularLargeStandardBody()
7274

73-
tmpl.headerTextProvider = CLKSimpleTextProvider(text: "try! India")
74-
tmpl.body1TextProvider = CLKSimpleTextProvider(text: "🇮🇳🐥🎉")
75+
tmpl.headerTextProvider = CLKSimpleTextProvider(text: headerText)
76+
tmpl.body1TextProvider = CLKSimpleTextProvider(text: bodyText)
7577
tmpl.body2TextProvider = CLKTimeIntervalTextProvider(start: firstSession.startTime as Date, end: lastSession.endTime as Date)
7678
let timelineEntry = CLKComplicationTimelineEntry(date: currentDate, complicationTemplate: tmpl)
7779
handler(timelineEntry)
@@ -125,7 +127,7 @@ class ComplicationController: NSObject, CLKComplicationDataSource {
125127
private extension Date {
126128
func toUTC() -> Date {
127129
// Conference timelines are defined in EST
128-
let jst = TimeZone(abbreviation: "IST")!
130+
let jst = TimeZone(abbreviation: "JST")!
129131
let calendar = Calendar.current
130132
guard let currentDate = calendar.date(byAdding: .second, value:
131133
-jst.secondsFromGMT(), to: self) else {

try! Extension/SessionsInterfaceController.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SessionsInterfaceController: WKInterfaceController {
2424

2525
if SessionsInterfaceController.first {
2626
let days = ConferenceDay.all
27-
WKInterfaceController.reloadRootControllers(withNames: ["Nov19"], contexts: [days[0]])
27+
WKInterfaceController.reloadRootControllers(withNames: ["day1", "day2"], contexts: [days[0], days[1]])
2828
SessionsInterfaceController.first = false
2929
}
3030

@@ -65,3 +65,12 @@ fileprivate extension SessionsInterfaceController {
6565
}
6666
}
6767
}
68+
69+
extension SessionType {
70+
var isOfficeHours: Bool {
71+
switch self {
72+
case .officeHours: return true
73+
default: return false
74+
}
75+
}
76+
}

try!/Base.lproj/Interface.storyboard

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="13529" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="AgC-eL-Hgc">
2+
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="13771" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="AgC-eL-Hgc">
33
<device id="watch38" orientation="portrait">
44
<adaptation id="fullscreen"/>
55
</device>
66
<dependencies>
77
<deployment identifier="watchOS"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13527"/>
9-
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="13507"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
9+
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="13756"/>
1010
</dependencies>
1111
<scenes>
12-
<!--try! Nov 19-->
12+
<!--try! Mar 1-->
1313
<scene sceneID="aou-V4-d1y">
1414
<objects>
15-
<controller identifier="Nov19" title="try! Nov 19" id="AgC-eL-Hgc" customClass="SessionsInterfaceController" customModule="try__Extension">
15+
<controller identifier="day1" title="try! Mar 1" id="AgC-eL-Hgc" customClass="SessionsInterfaceController" customModule="try__Extension">
1616
<items>
1717
<table alignment="left" pagingScroll="YES" id="OeU-Nt-vmO">
1818
<items>
@@ -48,10 +48,10 @@
4848
</objects>
4949
<point key="canvasLocation" x="220" y="345"/>
5050
</scene>
51-
<!--try! Sep 6-->
51+
<!--try! Mar 2-->
5252
<scene sceneID="VYM-ue-q9a">
5353
<objects>
54-
<controller identifier="Sep6" title="try! Sep 6" id="iUS-6L-mZG" customClass="SessionsInterfaceController" customModule="try__Extension">
54+
<controller identifier="day2" title="try! Mar 2" id="iUS-6L-mZG" customClass="SessionsInterfaceController" customModule="try__Extension">
5555
<items>
5656
<table alignment="left" id="raC-za-EKv">
5757
<items>

0 commit comments

Comments
 (0)