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

The UIControl class


There are many different starting points for the creation of your component. If you take a look at some of the custom controls available online, you will find that you can even start from a UIView subclass and draw the control parts in its drawRect method. There isn't a "right way to do it", but in order to be consistent with UIKit controls and have some advantages during the control's implementation, starting with the UIControl class is definitely a good choice.

This class provides an interface for the common structure of a control. You cannot use it directly, but it has to be subclassed by overriding some main methods if you want to implement your custom functionalities.

The UIControl class is, in turn, a subclass of UIView, meaning that you will get all the functions available for the views and your control can be directly attached as a subview of the current user interfaces.

The functionalities provided by the UIControl class are obviously all about control behaviors...