I am developing an iOS and watchkit with HomeKit integration. I have added some home and room into iOS app. Now i want to retrieve added home and Room.
Below is the code to get home in watchkit. I can get home in iOS by this code.
var homeWatchSore : HomeWatchStore!
var homeStore: HomeWatchStore {
return HomeWatchStore.sharedStore
}
var home: HMHome! {
return homeStore.home
}
var homeManager: HMHomeManager {
return homeStore.homeManager
}
func registerAsDelegate() {
homeManager.delegate = self
}
// Below function is used to get Home. But it always shows 0.
func getAllHome () {
let numberOfRows = homeManager.homes.count
}
Any idea how to get added Room and Home from iOS to watchKit app.