0

I have just updated my project to Swift 2.0 after updating to Xcode 7, and I have ran into an issue with my watch extension.

I want to have a watchOS 1 target, along with the watchOS 2 target, so I have created a second target for the watchOS 2 app. The problem is, I am getting an error in the watchOS 1 app on this line:

WKInterfaceController.openParentApplication(["parkName": park]) { userInfo, error in

'openParentApplication(_:reply:)' is unavailable

I can't figure out why. Is there a way that I need to specify that this is a watchOS 1 app?

Any ideas?

EDIT

I found this in the build settings for the extension, but there is no option to change it to watchOS 1.

enter image description here

user3746428
  • 11,047
  • 20
  • 81
  • 137
  • This question might help: http://stackoverflow.com/questions/30974685/xcode-7-supporting-watch-os1-and-os2?rq=1 – Vishwa Iyer Sep 13 '15 at 16:24

2 Answers2

5

As for the openParentApplication(_:reply:) method, it is only available in a WatchKit extension for watchOS 1 (thus the extension must be running on the iPhone).

For your watchOS 2 extension, you can use the new WatchConnectivity framework to communicate between your parent app and WatchKit extension.

Durul Dalkanat
  • 7,266
  • 4
  • 35
  • 36
0

A WatchOS 1 extension's Base SDK should be iOS (either an explicit version or Latest iOS), rather than watchOS 2.0.

Keller
  • 17,051
  • 8
  • 55
  • 72