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

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.

主站蜘蛛池模板: 南溪县| 乐安县| 永川市| 曲麻莱县| 镇赉县| 武威市| 宜良县| 郧西县| 霸州市| 五华县| 同江市| 永仁县| 大洼县| 广昌县| 开平市| 马关县| 永清县| 栖霞市| 昭通市| 凌海市| 孝昌县| 楚雄市| 措勤县| 门头沟区| 焦作市| 平果县| 阳山县| 宜城市| 南华县| 钟祥市| 永寿县| 错那县| 边坝县| 当阳市| 根河市| 邯郸县| 陇南市| 清涧县| 南川市| 阜南县| 北安市|