2016-06-27 45 views
0

我正在升級watchOS2以使用xCode 8.0 Beta觀看OS3並且我遇到了HKWorkoutSessionDelagate問題。見圖片。HKWorkoutSessionDelagate協議一致性

enter image description here

的修復,它的建議,崩潰的Xcode - 遇到類似問題或任何人都可以點我在分辨率方向將任何人 - 這將非常感激。

謝謝

回答

1

剛剛添加了這個代表,我沒有得到任何錯誤。使用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() 
    } 

}