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

Chapter 3. C-Quence – A Memory Game

We will be crafting an app that is a little more entertaining by using everything that we covered in Chapter 1, Exploring the New Platform, adding code which uses basic Swift features that most developers will find familiar and will address some of the topics that face the developer in creating software for a platform that presents some unique challenges.

C-Quence will be a game that challenges players' ability to memorize a sequence of colors generated by the app.

It is a game to be played in short bursts rather than prolonged activity, as one of the first things that becomes clear when using a physical device is that the watch is unsuited to tasks that take more than a short time to complete, which we will keep in mind as we look at the top-level design of the app.

Bear in mind that, although this is a very modest app in terms of the amount of coding it takes to bring it to completion, we still want to adhere to what some refer to as Best Practice (and others prefer to think of as simply learning from others' mistakes without the schadenfreude).

Here is a brief overview of how we will approach the various steps of development:

  • Plan the flow of the app
  • Set up the Xcode project
  • Build the interface in Interface Builder
  • Create the game logic class
  • Implement the Interface Controller logic
  • Hook up the classes and interface

The code presented in this chapter will reside fully on the watch, needing no support from the iPhone companion app. It will not be a complete and functioning app, that will come in the following chapter, but it will be a robust framework and we will have learned some important principles of software design.

主站蜘蛛池模板: 开封县| 诸城市| 利川市| 靖江市| 壶关县| 岳西县| 晋州市| 孟村| 广河县| 邵东县| 商河县| 黔南| 水富县| 襄城县| 肃北| 陆河县| 固阳县| 信阳市| 九龙坡区| 柏乡县| 都昌县| 沾化县| 阿坝县| 内丘县| 莆田市| 石家庄市| 西充县| 盐津县| 成都市| 和田市| 青海省| 加查县| 六枝特区| 波密县| 旬阳县| 玉门市| 九龙城区| 江达县| 澄城县| 洞口县| 永胜县|