Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit bb3f047

Browse files
committed
Watch improvements
1 parent 7d8be18 commit bb3f047

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Slide for Apple Watch Extension/InterfaceController.swift

+4-7
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ class InterfaceController: WKInterfaceController {
107107
checkTimer?.invalidate()
108108
checkTimer = nil
109109
} else {
110+
checkTimer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { (_) in
111+
self.loadData(WCSession.default)
112+
})
110113
return
111114
}
112115
session.sendMessage(["sublist": true], replyHandler: { (message) in
@@ -138,13 +141,7 @@ extension InterfaceController: WCSessionDelegate {
138141
loadingImage.setHidden(false)
139142
loadingImage.setImageNamed("Activity")
140143
loadingImage.startAnimatingWithImages(in: NSRange(location: 0, length: 15), duration: 1.0, repeatCount: 0)
141-
if activationState == .activated && session.isReachable {
142-
loadData(session)
143-
} else {
144-
checkTimer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true, block: { (timer) in
145-
self.loadData(WCSession.default)
146-
})
147-
}
144+
loadData(session)
148145
}
149146
}
150147
}

Slide for Apple Watch/Base.lproj/Interface.storyboard

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="14313.18" 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="14460.31" 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>
7-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
8-
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="14238.10"/>
7+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="14460.16"/>
99
</dependencies>
1010
<scenes>
1111
<!--DetailView-->

0 commit comments

Comments
 (0)