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

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.

主站蜘蛛池模板: 郓城县| 宣武区| 华池县| 福贡县| 古蔺县| 德州市| 西吉县| 昌乐县| 城市| 福安市| 平昌县| 曲沃县| 保靖县| 财经| 苏尼特右旗| 邵武市| 旅游| 新河县| 淳安县| 南乐县| 蓝山县| 周至县| 孟连| 同江市| 五莲县| 五大连池市| 阿坝县| 南召县| 建瓯市| 庄河市| 陆川县| 河源市| 三明市| 武强县| 高碑店市| 庆城县| 嘉鱼县| 普兰店市| 靖宇县| 万盛区| 铜鼓县|