0

I'm upgrading a watchOS2 to watchOS3 with xCode 8.0 Beta And I'm having trouble with HKWorkoutSessionDelagate. See image.

enter image description here

The fix-it suggestion, crashes xcode - anyone having similar issues or can anyone point me in the direction of the resolution - that would be much appreciated.

Thanks

Jono
  • 280
  • 1
  • 7
  • 15

1 Answers1

1

Just added this delegate, I didn't get any error. Using Xcode 8.0, Swift 3.0.

    //
//  InterfaceController.swift
//  asf WatchKit Extension
//
//  Created by Alvin Varghese on 27/06/16.
//  Copyright © 2016 Swift Coder. All rights reserved.
//

import WatchKit
import Foundation
import HealthKit

extension InterfaceController : HKWorkoutSessionDelegate
{
    func workoutSession(_ workoutSession: HKWorkoutSession, didChangeTo toState: HKWorkoutSessionState, from fromState: HKWorkoutSessionState, date: Date)
    {

    }

    func workoutSession(_ workoutSession: HKWorkoutSession, didFailWithError error: NSError){

    }
}


class InterfaceController: WKInterfaceController {

    override func awake(withContext context: AnyObject?) {
        super.awake(withContext: context)

        // Configure interface objects here.
    }

    override func willActivate() {
        // This method is called when watch view controller is about to be visible to user
        super.willActivate()
    }

    override func didDeactivate() {
        // This method is called when watch view controller is no longer visible
        super.didDeactivate()
    }

}