Does anybody know what is the difference between Installed
& Hidden
properties of WKInterfaceLabel
?
Both of them show/hide the label .
For WatchKit apps, all interface elements required in an app scene have to be created in the storyboard in Xcode and installed with the app... they cannot be added programatically at runtime. The hidden attribute sets whether an element is hidden or visible at launch. This can be subsequently changed programatically, and so toggling the hidden attribute is used in a manner akin to adding or removing items from a view in iOS.
The installed attribute sets whether an interface element is installed at all in the Watch App when it is copied to the Watch. If an item is not installed, it cannot be used.
A principal way in which you might use this installed attribute is to have different interface elements on different sizes of Apple Watch. By clicking the + to the left of the Installed checkbox in Xcode, you have the option to set different values of this attribute for different Apple Watch sizes.
Having selected a Watch size, you can then set different values for that watch size compared to the default size:
These changes can also be made by selecting the Apple Watch size at the bottom of the interface builder window, and making the changes directly on the storyboard. These are simply two paths to make exactly the same changes, rather than actual different alternative solutions.
Note that Apple recommend that Watch app interfaces should as much as possible be the same across all Apple Watches, with interface elements varying only in size. It is possible to make these size changes for many interface elements using size constraints that set the size relative to the element's container. However, for buttons with images this is a method for installing buttons with images sized specifically for each watch.
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