What have I done to solve this problem?
Create in .h file
NSInteger PickerIndex;
fast
var PickerIndex: Int
Then in my .m
- (IBAction)pickerAction:(NSInteger)index { PickerIndex = index; }
fast
@IBAction func pickerAction(index: Int) { PickerIndex = index }
* Remember to link IBAction in Interface Builder
And then use it in pickerDidSettle method
-(void)pickerDidSettle:(WKInterfacePicker *)picker{ NSLog(@"Selected Index: %ld",(long)PickerIndex); }
fast
func pickerDidSettle(_ picker: WKInterfacePicker) { print(PickerIndex) }
Bosoud
source share