Liftoff
Liftoff

Reputation: 25412

Can you create apple watch interfaces programmatically?

I have done a lot of searching and I cannot seem to find a solid answer to this anywhere.

In all of Apple's documentation, whenever they talk about adding anything to your Apple Watch view, they always say, "Go to the storyboard and drag and drop" and the like.

I am used to creating my views the old-fashioned way, programmatically. For example:

UIView* aView = [[UIView alloc] init];
[self.view addSubview: aView];

I can't seem to find an equivalent to doing this on an Apple Watch. Does everything have to be created in the Storyboard editor?

For instance:

WKInterfaceButton* button = [WKInterfaceButton init];
//How do I add this to my InterfaceController?

Upvotes: 3

Views: 330

Answers (0)

Related Questions