thomaspaulmann/HeartControl

Update to latest Swift version

sidan5 opened this issue · 2 comments

Currently this code is unusable...

Thanks!

@sidan5 feel free to port it to the latest Swift version.

Got it working with few tweaks.

  1. 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>
  1. change the Swift Language Version to Swift 4 (Build Settings/Swift Compiler - Language section)
  2. click fix on all suggestions
  3. add @escaping on line 13 in Heart Control WatchKit Extension/AuthorizationManager.swift
static func requestAuthorization(completionHandler: @escaping ((_ success: Bool) -> Void)) {