Restricting Complication Families

Sometimes, a particular complication family just doesn’t make sense for your data. A complication to show a random inspirational quote probably wouldn’t make sense in the Modular Small family. To that end, you can tell watchOS which complication families you support, so that it won’t offer your complication to the user on the wrong watch face. In Xcode, open your project settings; then select the NomNomNom WatchKit Extension target. Under the Info tab, there are two key/value pairs of interest. The first, CLKComplicationPrincipalClass, tells watchOS which class it should instantiate to create complication data. In this case, you can leave it at its default value of $(PRODUCT_MODULE_NAME).ComplicationController ...

Get Developing for Apple Watch, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.