Skip to content

Commit 53284ce

Browse files
author
Steve Trease
committed
ctrl I to reinvent all functions.
1 parent 40fb49b commit 53284ce

File tree

13 files changed

+53
-53
lines changed

13 files changed

+53
-53
lines changed

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
605
1+
611

iOS Steps Today/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>605</string>
22+
<string>611</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionMainStoryboard</key>

iOS Steps Today/TodayViewController.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class TodayViewController: UIViewController, NCWidgetProviding {
4747
stepsLabel2.textAlignment = .center
4848

4949
stepsLabel2.isEnabled = false
50-
50+
5151
checkHealthKitAuthorization()
5252

5353
updateView ()
@@ -66,7 +66,7 @@ class TodayViewController: UIViewController, NCWidgetProviding {
6666
super.didReceiveMemoryWarning()
6767
// Dispose of any resources that can be recreated.
6868
}
69-
69+
7070

7171
@IBAction func screenTappedTriggered(sender: AnyObject) {
7272
print ("Screen tapped in Today Extension ", type (of: sender))
@@ -101,13 +101,13 @@ class TodayViewController: UIViewController, NCWidgetProviding {
101101
numberFormatter.numberStyle = NumberFormatter.Style.decimal
102102

103103
/*
104-
getTodayStepCount (completion: { (steps) in
105-
if steps != -1.0 {
106-
OperationQueue.main.addOperation {
107-
self.stepsLabel2.countFromCurrentValue(to: CGFloat(steps!), withDuration: 0.5)
108-
}
109-
}
110-
})
104+
getTodayStepCount (completion: { (steps) in
105+
if steps != -1.0 {
106+
OperationQueue.main.addOperation {
107+
self.stepsLabel2.countFromCurrentValue(to: CGFloat(steps!), withDuration: 0.5)
108+
}
109+
}
110+
})
111111
*/
112112

113113
getTodayStepCount (completion: { (steps) in

iOS Steps Watch Extension/ExtensionDelegate.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ import WatchKit
1010
import HealthKit
1111

1212
class ExtensionDelegate: NSObject, WKExtensionDelegate {
13-
13+
1414
func applicationDidFinishLaunching() {
1515
// Perform any final initialization of your application.
1616
}
17-
17+
1818
func applicationDidBecomeActive() {
1919
// 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.
2020
}
21-
21+
2222
func applicationWillResignActive() {
2323
// 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.
2424
// Use this method to pause ongoing tasks, disable timers, etc.
2525
}
26-
26+
2727
func handle(_ backgroundTasks: Set<WKRefreshBackgroundTask>) {
2828
// Sent when the system needs to launch the application in the background to process tasks. Tasks arrive in a set, so loop through and process each one.
2929
for task in backgroundTasks {
@@ -47,5 +47,5 @@ class ExtensionDelegate: NSObject, WKExtensionDelegate {
4747
}
4848
}
4949
}
50-
50+
5151
}

iOS Steps Watch Extension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>605</string>
22+
<string>611</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionAttributes</key>

iOS Steps Watch Extension/InterfaceController.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import WatchConnectivity
1313

1414
// class InterfaceController: WKInterfaceController, WCSessionDelegate {
1515
class InterfaceController: WKInterfaceController {
16-
16+
1717
@IBOutlet var stepsLabel: WKInterfaceLabel!
1818
@IBOutlet var averageLabel: WKInterfaceLabel!
1919
@IBOutlet var yesterdayLabel: WKInterfaceLabel!
@@ -63,7 +63,7 @@ class InterfaceController: WKInterfaceController {
6363
self.stepsLabel.setTextColor(.red)
6464
}
6565
}
66-
66+
6767
self.updateView()
6868
}
6969

@@ -97,7 +97,7 @@ class InterfaceController: WKInterfaceController {
9797
// only update if not updated already today
9898
if (!cal.isDateInToday(sevenDayStepAverageLastUpdated)) {
9999
getSevenDayStepAverage (completion: { (averageSteps) in
100-
if averageSteps != -1.0 {
100+
if averageSteps != -1.0 {
101101
self.sevenDayStepAverage = averageSteps!
102102
self.sevenDayStepAverageLastUpdated = Date()
103103
OperationQueue.main.addOperation {
@@ -120,13 +120,13 @@ class InterfaceController: WKInterfaceController {
120120
OperationQueue.main.addOperation {
121121
let numberString = self.numberFormatter.string(from: steps! as NSNumber)
122122
self.yesterdayLabel.setText(numberString!)
123-
}
123+
}
124124
}
125125
})
126126

127127
}
128128
}
129-
129+
130130

131131
func getTodayStepCount(completion:@escaping (Double?)->())
132132
{

iOS Steps Watch Extension/NotificationController.swift

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,32 @@ import UserNotifications
1212

1313

1414
class NotificationController: WKUserNotificationInterfaceController {
15-
15+
1616
override init() {
1717
// Initialize variables here.
1818
super.init()
1919

2020
// Configure interface objects here.
2121
}
22-
22+
2323
override func willActivate() {
2424
// This method is called when watch view controller is about to be visible to user
2525
super.willActivate()
2626
}
27-
27+
2828
override func didDeactivate() {
2929
// This method is called when watch view controller is no longer visible
3030
super.didDeactivate()
3131
}
32-
32+
3333
/*
34-
override func didReceive(_ notification: UNNotification, withCompletion completionHandler: @escaping (WKUserNotificationInterfaceType) -> Swift.Void) {
35-
// This method is called when a notification needs to be presented.
36-
// Implement it if you use a dynamic notification interface.
37-
// Populate your dynamic notification interface as quickly as possible.
38-
//
39-
// After populating your dynamic notification interface call the completion block.
40-
completionHandler(.custom)
41-
}
42-
*/
34+
override func didReceive(_ notification: UNNotification, withCompletion completionHandler: @escaping (WKUserNotificationInterfaceType) -> Swift.Void) {
35+
// This method is called when a notification needs to be presented.
36+
// Implement it if you use a dynamic notification interface.
37+
// Populate your dynamic notification interface as quickly as possible.
38+
//
39+
// After populating your dynamic notification interface call the completion block.
40+
completionHandler(.custom)
41+
}
42+
*/
4343
}

iOS Steps Watch/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>1.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>605</string>
22+
<string>611</string>
2323
<key>UIBackgroundModes</key>
2424
<array/>
2525
<key>UISupportedInterfaceOrientations</key>

iOS Steps/Base.lproj/LaunchScreen.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
2222
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2323
<subviews>
24-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 605 (c28ee8a)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
24+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 611 (40fb49b)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
2525
<rect key="frame" x="132.5" y="527" width="55.5" height="21"/>
2626
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2727
<nil key="textColor"/>

iOS Steps/Base.lproj/LaunchScreen.storyboardbak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
2222
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
2323
<subviews>
24-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 604 (c28ee8a)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
24+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Build: 610 (40fb49b)" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yhA-lX-4Of" userLabel="APP_VERSION">
2525
<rect key="frame" x="132.5" y="527" width="55.5" height="21"/>
2626
<fontDescription key="fontDescription" type="system" pointSize="17"/>
2727
<nil key="textColor"/>

0 commit comments

Comments
 (0)