Learning iOS UI Development - Raydelto Hernandez - E-Book

Learning iOS UI Development E-Book

Raydelto Hernandez

0,0
23,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

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.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 226

Veröffentlichungsjahr: 2015

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Learning iOS UI Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. UI Fundamentals
Exploring windows
The contents of windows
Configuring windows
Working with views
Defining the view's geometry
The bounds property
The frame property
The center property
UI hierarchy and views inheritance
Managing with the hierarchy
View and subview visibility
Hierarchy events
Notes about debug
Hands-on code
View drawing and life cycle
View controllers and views
Summary
2. UI Components Overview – UIKit
Exploring text elements
Presenting text with UILabel
Receiving user input with UITextField
Multiline text with UITextView
Notes about the keyboard
Keyboard events
Keyboard configuration
Exploring buttons and selectors
UIButton and user interaction
The target-action pattern
Boolean selection with UISwitch
Control customization
Selecting values with UISlider
Control customization
User choices through UISegmentedControl
Control customization
Selecting values with UIPickerView and UIDatePicker
Updating values with UIStepper
Control customization
View-based components
Showing progress with UIProgressView
Control customization
Working with UIActivityIndicatorView
Control customization
Introducing UIImageView and UIImage
Introducing UIScrollView
Managing and presenting structured data
Introducing UITableView
Introducing UICollectionView
The UIAppearance protocol
Hands-on code
Summary
3. Interface Builder, XIB, and Storyboard
Interface Builder
An overview of the editor
Working with XIB files
Managing user interfaces with Storyboards
Connecting user interfaces with your code
Implementing navigation with Storyboard and segues
The unwind segue
Hands-on code
Summary
4. Auto Layout
How Auto Layout works
Xcode and Auto Layout
Practical introduction to constraints
Xcode helpers
Intrinsic content size
Independence from screen size
Updating constraints programmatically
Working with Auto Layout programmatically
Initializing the views
Adding constraints
Working with multiple views
Relations between views
Summary
5. Adaptive User Interfaces
UI definition with size classes
User interface's traits
Trait collection and trait environment
Working with trait collections
Size classes and Interface Builder
Hands-on code
Image assets and size classes
Working with Dynamic Type
Configurable text size
Exploring text styles
Improving Auto Layout structures with UIStackView
Setting up UIStackView
UIStackView and adaptive layouts
Summary
6. Layers and Core Animation
Exploring layers
Layers and views
The content of a layer
Flat layer
The contents property
The layer delegate
Layer subclassing
Contents properties
The layer geometry
The layers hierarchy
The appearance of layers
Working with core animation
Layers and animations
Implicit animations
Properties animations
Initializing and launching the animation
Keeping the animation result
Handling timing and repetitions
Animations group
Keyframe animations
Removing animations from a layer
View animations
Summary
7. UI Interactions – Touches and Gestures
Events and touches
Touch phases
The UITouch class
Responder chain
Hit-testing
Responding to touch events
Gestures and gesture recognizers
Working with gesture recognizers
Gesture recognizer states
Hands-on code
Summary
8. How to Build Custom Controls
The Thermostat control
Designing a custom control
The UIControl class
Implementing the ThermostatSlider control
Control initialization
Drawing the control
Prototyping using playground
Drawing the borders
Drawing the track
Drawing the handle
Updating the control value
Updating borders
Updating the track
Updating the handle
Touch tracking
Beginning tracking
Continuing tracking
Ending tracking
Sending actions
Customizing the control with UI Appearance
Summary
9. Introduction to Core Graphics
Drawing on the graphic context
How drawing works
Handling the graphic states
The coordinate system
UIKit helpers
Drawing with fill and stroke options
Drawing with blending modes
Drawing with paths
Drawing with paths
Path initialization
Building a path
Drawing the path
Summary
Index

Learning iOS UI Development

Learning iOS UI Development

Copyright © 2015 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: December 2015

Production reference: 1181215

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78528-819-7

www.packtpub.com

Credits

Author

Yari D'areglia

Reviewers

Nicola Armellini

Christian Stehno

Commissioning Editor

Nadeem N. Bagban

Acquisition Editor

Manish Nainani

Content Development Editor

Rashmi Suvarna

Technical Editor

Humera Shaikh

Copy Editor

Shruti Iyer

Project Coordinator

Judie Jose

Proofreader

Safis Editing

Indexer

Monica Ajmera Mehta

Graphics

Jason Monteiro

Production Coordinator

Nilesh Mohite

Cover Work

Nilesh Mohite

About the Author

Yari D'areglia is a developer with 15 years of experience in software architecture and development. During the last 4 years, he built successful iOS and OS X applications for developers as well as the mainstream public.

Yari, together with Nicola Armellini, founded Jumpzero, a company based in Italy that released countless mobile, desktop, and web applications.

Currently, he is employed as a senior iOS engineer at Neato Robotics, a company based in Silicon Valley, where he works on the communication between robots and iOS devices.

Yari writes at www.ThinkAndBuild.it, a blog focused on iOS development with a strong focus on user interface development.

You can reach him on Twitter at @bitwaker.

I'd like to thank Nicola Armellini for taking the time to review this book and teaching me countless things about my work and life. Thanks, brother!

Special thanks go to my future wife, Lorena. She was extremely supportive and accepted all my "I'm busy, honey; I need to finish this chapter..." with a gentle smile. You are awesome; I love you.

Thanks, mom, your ragù and your words were both of vital importance during the writing of the last few chapters. You're a strong woman, and I'm proud to be your son.

Many thanks and appreciation go to everyone who contributed to the production of this book: Manish, Ritika, Rashmi, and Humera. Thank you for being so kind and professional.

Last but not least, I would like to thank my greatest friends, Simo, Luke, and Stefano (Panzer). Our next role-playing session is on its way.

About the Reviewers

Nicola Armellini is a designer from Italy who constantly crosses the boundary between technology and communication.

First approaching the industry through the video game medium, he partnered with Yari D'Areglia and founded Jumpzero, specializing in the user experience and interface design of OS X and iOS applications. At the same time, Nicola helped grow the audience of Yari's Think & Build blog by editing and reviewing his in-depth tutorial articles.

A fan of redistributing knowledge and making it accessible, he taught his craft and its implications in terms of marketing and communication as a lecturer at European Institute of Design in Milan.

As a side project slowly turned into his main focus, Nicola started fiddling with virtual reality and exploring new ways of interacting with machines and CG environments, questioning the status quo of how information is presented and manipulated.

He now studies to become an aerospace engineer and can be found at nicolaarmellini.com.

Christian Stehno studied computer science and got his diploma from the University of Oldenburg in 2000. Since then, he has worked on different topics in computer science. As researcher on theoretical computer science at University, Christian switched to embedded system design at a research institute later on. In 2010, he started his own company, CoSynth, which develops embedded systems and intelligent cameras for industrial automation. In addition, Christian is a long-time member of the Irrlicht 3D Engine developer team.

www.PacktPub.com

Support files, eBooks, discount offers, and more

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.

To my father, Max.

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.

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 <[email protected]>, 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 <[email protected]> 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 <[email protected]>, and we will do our best to address the problem.