Mehsam Saeed
Mehsam Saeed

Reputation: 275

How to implement apple watch crown delegate using objective c

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

Answers (1)

user9106403
user9106403

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

Related Questions