Book Image

Learning iOS UI Development

Book Image

Learning iOS UI Development

Overview of this book

Through this comprehensive one-stop guide, you’ll get to grips with the entire UIKit framework and in a flash, you’ll be creating modern user interfaces for your iOS devices using Swift. Starting with an overview of the iOS drawing system and the available tools, you will then learn how to use these technologies to create adaptable layouts and custom elements for your applications. Next, you’ll be introduced to other topics such as animation and code-drawing with Core Graphics, which will give you all the knowledge you need to create astonishing user interfaces. By the end of this book, you will have a solid foundation in iOS user interface development and will have gained valuable insights on the process of building firm and complex UIs.
Table of Contents (16 chapters)
Learning iOS UI Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Through this comprehensive one-stop guide, you'll get to grips with the entire UIKit framework and creating modern user interfaces for your iOS devices using Swift. Starting with an overview of the iOS drawing system and available tools, you will learn how to use these technologies to create adaptable layouts and custom elements for your applications. You'll then be introduced to other topics such as animation and code drawing with core graphics, which will give you all the knowledge you need to create astonishing user interfaces. By the time you reach the end of this book, you will have a solid foundation in iOS user interface development and have gained a valuable insight into the process of building firm and complex UIs.

What this book covers

Chapter 1, UI Fundamentals, starts by describing how interfaces are structured and drawn and then presents some really important elements, such as windows and views.

Chapter 2, UI Components Overview – UIKit, is an overview of the UIKit framework. It's a guided tour through the main UIKit elements, from their usage inside an app to their customization.

Chapter 3, Interface Builder, XIB, and Storyboard, gives an overview of the Xcode tools used to set up and build UIs.

Chapter 4, Auto Layout, is the key to understanding how Auto Layout works. It describes in detail how to create dynamic layouts.

Chapter 5, Adaptive User Interfaces, discusses a very important topic: how to improve user experience and provide interfaces that can adapt to different orientations, screen sizes, and user preferences using the latest advancements introduced with iOS 8 and 9.

Chapter 6, Layers and Core Animation, focuses on CALayer in the context of core animation. It illustrates how to achieve animations in iOS using two different approaches.

Chapter 7, UI Interactions – Touches and Gestures, analyzes the main way users interact with UIs—through touch. It answers questions such as "how is this information passed from the screen to the views?" and "how can we build an engaging UI using gestures?"

Chapter 8, How to Build Custom Controls, explains how to build custom controls after learning how these controls work in the previous chapters.

Chapter 9, Introduction to Core Graphics, is a final quick overview of the core graphics (Quartz 2D) framework to show you how to perform custom drawings with iOS.

What you need for this book

In order to be able to run the code examples, you need a Mac computer with OS X and Xcode installed. The suggested minimal version is OS X 10.11.1 and Xcode 7.1.

Who this book is for

This easy-to-follow guide is perfect for beginner-level iOS developers who want to become proficient in user interface development. It is also useful for experienced iOS developers who need a complete overview of this broad topic all in one place without having to consult various sources.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The properties that define the view geometry are frame, bounds, and center and they are configured using the geometry structures you just saw."

A block of code is set as follows:

        // Define a point
        let point = CGPoint(x: 20, y: 10)

        // Define a size
        let size = CGSize(width: 20, height: 10)

        // Define a rect using size and point
        let rect_A = CGRect(origin: point, size: size)

        // Define a rect using x, y, width and height data
        let rect_B = CGRect(x: 15, y: 10, width: 100, height: 30)

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

enum UIUserInterfaceSizeClass : Int {
    case Unspecified
    case Compact
    case Regular
}

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Create a new asset by clicking on the + symbol and selecting New Image Asset."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/LearningiOSUIDevelopment_Graphics.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.