Reputation: 275
I am working on apple watch application where i need to use crown to update label value .I have achieved the functionality using swift. In swift we have property named crownSequencer to implement crown delegate like
crownSequencer.delegate=self; crownSequencer.focus();
but I am unable to fined a way to implement it in objective c, because objective c does not show any property named crownSequencer
any help would be appreciated.
Upvotes: 1
Views: 257
Reputation:
CrownSequence can be accessible via InterfaceController object.
In Objective C it can be accessed by this way :
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
// Configure interface objects here.
self.crownSequencer.delegate = self;
}
- (void)willActivate {
[super willActivate];
[self.crownSequencer focus];
}
NOTE ::[self.crownSequencer focus] should not be call within (void)awakeWithContext:(id)context otherwise delegate method will not be call
Here you can find more info
https://developer.apple.com/documentation/watchkit/wkcrownsequencer?language=objc
Upvotes: 1