Chapter 11.  Simon Says

Until now, the programs we have written have been focused on text; they have been console applications as described in Chapter 3, Say Hello. A very central part of an iPhone application is the User Interface (UI)-the interface in which the user is able to do gestures, such as drag, force-touch, swipe, and more; the interface in which the user is able to communicate back and forth with the running application.

The following two chapters will focus on the UI in an iOS application. The reader will acquire the necessary knowledge and skills in order to be able to write programs that leverage a UI. To summarize, this chapter will cover the following topics:

  • A recap of the concept of a Graphical User Interface (GUI)
  • A guide to setting up a new iOS project that will include a UI
  • An introduction to how we can lay out a view using Xcode's built-in tool Interface Builder (IB) and something called storyboards
  • A guide to building a small application called Simon Says, that uses a GUI

GUI

Before going into detail about how to create a UI for our applications, let's remember what a GUI is? You might remember how we introduced two different kinds of interfaces in Chapter 3, Say Hello: a console interface and a GUI. While a console application is very much focused around text when communicating with a user, a GUI leverages on the fact that we have screens on most electronic devices, for example, your TV:

GUI

More or less every TV today ships with a GUI that you can use to adjust your settings, such as the sound level or the level of brightness on your TV. Newer TVs, so-called Smart TVs, also ship with a lot of features, such as a web browser and access to Netflix and HBO. You usually interact with your TV using your remote control. The TV gives you feedback on your choices or commands using the remote through sound or by visually updating what you see on the TV.

A GUI is about interacting with the user using visuals. These visuals can be items such as windows, buttons, sliders, icons, and menus and are present in most operating systems, such as the systems you use when using an iPhone, iMac, or a computer running the Windows operating system.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.169.94