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

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.

主站蜘蛛池模板: 博白县| 屏东市| 云南省| 大渡口区| 炎陵县| 怀远县| 新平| 晴隆县| 红安县| 朔州市| 安新县| 绥宁县| 彩票| 广东省| 邮箱| 威远县| 平山县| 嵊泗县| 长沙市| 万源市| 江津市| 平远县| 龙山县| 许昌市| 青川县| 阳新县| 枣庄市| 安仁县| 武乡县| 古交市| 多伦县| 修文县| 黎川县| 漠河县| 新和县| 秀山| 敦煌市| 增城市| 长治县| 新龙县| 济阳县|