I'm using Xcode Version 7.0 beta 3. When attempting to use a WKInterfacePicker, I get an error.
Here is my code for my WKInterfaceController:
import WatchKit
import Foundation
class RBWelcomeVC: WKInterfaceController {
@IBOutlet var pickerAllWorkouts: WKInterfacePicker!
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(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()
}
}
Notice my IBOutlet. When I created it by Control dragging from the storyboard. It created the outlet and immediately put this error with it:
Use of undeclared type 'WKInterfacePicker'
Since that didn't work, I tried creating the outlet manually. I typed:
@IBOutlet var pickerAllWorkouts: WKInterfa...
When attempting to let Xcode finish the autocomplete, I noticed that WKInterfacePicker was not a suggestion. The picker did not exist. Is this just a bug or am I doing something wrong?
You should check that the "Target Membership" of the RBWelcomeVC.swift file is not included in your iOS app, it only should be on your Apple Watch Extension. That worked for me.
"Target Membership" is located in the side bar of Xcode (AKA: Utilities)
Need more reputation to post image.
EDIT: image: http://imgur.com/rQ1xwtG
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With