Skip to content

Commit eed26b3

Browse files
author
Steve Trease
committed
Slightly simplified to run on iPhone 8.
Haptic feedback wasn't on main thread.
1 parent 3313153 commit eed26b3

File tree

9 files changed

+14
-25
lines changed

9 files changed

+14
-25
lines changed

build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
627
1+
635

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>627</string>
22+
<string>635</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionMainStoryboard</key>

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>627</string>
22+
<string>635</string>
2323
<key>NSExtension</key>
2424
<dict>
2525
<key>NSExtensionAttributes</key>

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>627</string>
22+
<string>635</string>
2323
<key>UIBackgroundModes</key>
2424
<array/>
2525
<key>UISupportedInterfaceOrientations</key>

iOS Steps/AppDelegate.swift

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,12 @@ import WatchConnectivity
2222
// Override point for customization after application launch.
2323
print (NSURL (fileURLWithPath: "\(#file)").lastPathComponent!, "\(#function)")
2424
UserDefaults.standard.setValue(false, forKey: "_UIConstraintBasedLayoutLogUnsatisfiable")
25-
26-
// enable debugging overlay - double tap status bar to activate
27-
// http://ryanipete.com/blog/ios/swift/objective-c/uidebugginginformationoverlay/?utm_campaign=iOS%2BDev%2BWeekly&utm_medium=email&utm_source=iOS_Dev_Weekly_Issue_303
28-
let overlayClass = NSClassFromString("UIDebuggingInformationOverlay") as? UIWindow.Type
29-
_ = overlayClass?.perform(NSSelectorFromString("prepareDebuggingOverlay"))
30-
31-
// UIApplication.shared.delegate?.window??.tintColor = .green
32-
33-
// if WCSession.isSupported() {
34-
// watchConnectivityHandler = WatchConnectivityHandler()
35-
// print ("WCSession supported")
36-
// } else {
37-
// print ("WCSession not supported")
38-
// }
39-
25+
4026
let formatter = DateFormatter()
4127
formatter.dateFormat = "HH:mm"
4228

29+
30+
/*
4331
let stepCountSampleType = HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)
4432

4533
let stepCountQuery = HKObserverQuery(sampleType: stepCountSampleType!, predicate: nil) {
@@ -59,7 +47,8 @@ import WatchConnectivity
5947
completionHandler()
6048
}
6149

62-
healthKitManager.healthStore.execute(stepCountQuery)
50+
healthKitManager.healthStore.execute(stepCountQuery
51+
*/
6352

6453
return true
6554
}

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: 627 (8703ee5)" 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: 635 (3313153)" 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: 626 (8703ee5)" 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: 634 (3313153)" 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/DayViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class DayViewController: UIViewController {
7878
func drawScreen () {
7979
print (NSURL (fileURLWithPath: "\(#file)").lastPathComponent!, "\(#function)")
8080

81-
let generator = UIImpactFeedbackGenerator(style: .light)
81+
// let generator = UIImpactFeedbackGenerator(style: .light)
8282

8383
healthKitManager.getTodayStepCount (completion: { (steps) in
8484
OperationQueue.main.addOperation {
@@ -88,7 +88,7 @@ class DayViewController: UIViewController {
8888
let number = numberFormatter.string(from: healthKitManager.stepsToday as NSNumber)!
8989
self.todayStepCountLabel.text = "\(number) today"
9090
}
91-
generator.impactOccurred()
91+
// generator.impactOccurred()
9292
})
9393

9494
healthKitManager.getYesterdayStepCount (completion: { (steps) in

iOS Steps/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</dict>
2929
</array>
3030
<key>CFBundleVersion</key>
31-
<string>627</string>
31+
<string>635</string>
3232
<key>LSRequiresIPhoneOS</key>
3333
<true/>
3434
<key>NSHealthShareUsageDescription</key>

0 commit comments

Comments
 (0)