Update to latest Swift version
sidan5 opened this issue · 2 comments
sidan5 commented
Currently this code is unusable...
Thanks!
thomaspaulmann commented
@sidan5 feel free to port it to the latest Swift version.
miran248 commented
Got it working with few tweaks.
- add the following to
Heart Control WatchKit Extension/Info.plist
<key>NSHealthShareUsageDescription</key>
<string>We need access to your health data to read your heart rate.</string>
<key>NSHealthUpdateUsageDescription</key>
<string>We need to save your health progress to your Apple Watch.</string>
- change the
Swift Language Version
toSwift 4
(Build Settings/Swift Compiler - Language
section) - click
fix
on all suggestions - add
@escaping
on line 13 inHeart Control WatchKit Extension/AuthorizationManager.swift
static func requestAuthorization(completionHandler: @escaping ((_ success: Bool) -> Void)) {