官术网_书友最值得收藏!

Ideas for self study

Before moving on, it's a good idea to play around with the features and code we have covered in this chapter and explore what happens when changing some of the details to see what effect it has on the app and its interface.

One excellent candidate is the borderGroup object we used to fake the button border. If you option-click on the declaration at the top of the InterfaceController code, you will be presented with a pop-up window that provides you, with among much other useful information, a list of WKInterfaceGroup settable properties which are available to you. Start by typing self.borderGroup.set and let Xcode's code completion show you what's on offer:

A Command-click on one of the UIColor methods such as .redColor() will take you to a list of convenience methods which create a limited number of preset colors. Why stick to a choice of three? Why not 10? (But you'll have to scroll!)

You might also like to print() a warning to the console when the modal dialog returns nil after you select Cancel instead of a color from the modal view.

主站蜘蛛池模板: 车致| 葵青区| 巨野县| 商都县| 南漳县| 宾阳县| 巍山| 镇沅| 思南县| 龙胜| 同心县| 天祝| 开封市| 栾城县| 高阳县| 沁水县| 潜山县| 宜良县| 禹州市| 正定县| 贵定县| 修水县| 井陉县| 霞浦县| 临泽县| 尚志市| 凌源市| 义马市| 永昌县| 柘荣县| 新津县| 山阴县| 西和县| 镇赉县| 广州市| 绥江县| 横山县| 马山县| 日照市| 横峰县| 伊川县|