David Robertson
David Robertson

Reputation: 1581

WatchKit - iPhone not available screen

Since i migrated my project to watchOS2 - the "iPhone not available" screen suddenly disappeared.

In OS1 this was a "default" behaviour, now the watch has it's own dataset, which creates issues when i try to sync the watch and phone together.

My question is - how do i check if the phone is paired on not, stop performing any actions (like in OS1) if it's not and bring back that screen?

Screen example: http://belencruz.com/wp-content/uploads/2015/06/IMG_20150624_175906-e1435296319135-1024x979.jpg

Upvotes: 2

Views: 43

Answers (1)

Arsen
Arsen

Reputation: 10951

You have to use paired on WCSession instance.

import WatchConnectivity

if WCSession.defaultSession().paired {

}

paired

A Boolean indicating whether the current iPhone is paired to an Apple Watch. (read-only)

Also you defiantly have to check watchAppInstalled.

A Boolean value indicating whether the Watch app is installed on the currently paired and active Apple Watch. (read-only)

Upvotes: 1

Related Questions