HeartControl icon indicating copy to clipboard operation
HeartControl copied to clipboard

Update to latest Swift version

Open sidan5 opened this issue 4 years ago • 2 comments

Currently this code is unusable...

Thanks!

sidan5 avatar Oct 01 '19 10:10 sidan5

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

thomaspaulmann avatar Feb 17 '20 00:02 thomaspaulmann

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)) {

miran248 avatar Jun 24 '20 09:06 miran248