Using an Unresolved WKExtension Identifier

I want to make a phone call from Apple Watch. I imported WatchKit. Then I put this code in my method:

if let telURL=NSURL(string:"tel:5553478") { let wkExtension=WKExtension.sharedExtension() wkExtension.openSystemURL(telURL) } 

This shows me an error: using the unresolved identifier "WKExtension" on line 2. I don't know what I'm doing wrong: /

-one
swift watchkit apple-watch
source share
1 answer

WKExtension is only available on WatchOS 2.0, as you can see from the Apple preerelease reference . Therefore, I assume that you are either not using Xcode 7, or are working on the v1.0 clock extension.

Create a new target and select Windows> Application.

0
source share

All Articles