Welcome to this book! What you will find between the covers of this book will hopefully set you on your way to producing your own iOS applications; not only that, it will also help you to start writing code that can be moved with the minimum fuss to Android and Windows 8 mobile phones and tablets. Hold on to your hats folks!
Chapter 1, Installing the Xamarin Product Range for Android and iOS, explains how to set up your PC or Mac to develop apps for your iOS device.
Chapter 2, The User Interface, deals with creating a user interface and its key components.
Chapter 3, Views and Layouts, explains how creating a user interface isn't just about putting buttons on a screen; you also need to start with the right application type.
Chapter 4, Controllers, gives the basics of the two most used forms of Navigation and View. iOS uses an MVC system (Model, View, Controller). We've had the first two, now let's see about controllers.
Chapter 5, UI Controls, explains how the controls are more than just buttons and textboxes; we can really go to town on how these bad boys look.
Chapter 6, Events, explains how, without events, your iOS device is nothing more than a lump of plastic. iOS is rich in events, and they're all here.
Chapter 7, Gestures, covers the operations that iOS makes a big play on, such as being able to pinch, sweep, and move around the screen. These operations are called gestures and they're very simple to use!
Chapter 8, Threading, deals with iOS as a multithreaded system. How these threads interact determines how an app will behave.
Chapter 9, Threading Tasks, deals with task scheduling as well as asynchronous tasks. It explains how Android works with these tasks.
Chapter 10, Animation, gives an insight into animation, as it is an important part of any app.
Chapter 11, Handling Data, explains how it is surprisingly easy to handle and manipulate large amounts of complex data within C# and iOS.
Chapter 12, Peripherals, explains how to code to take advantage of the calling and texting feature on your phone as well as use the GPS system.
Chapter 13, User Preferences, explains how to store your settings for the built-in system as well as create your own cross-platform settings code. Storing your settings is a very important part of any app.
Chapter 14, Testing and Publishing, deals with how to test and publish the app after you have finished developing it.
A Mac (running OS.X Lion or Mountain Lion) with Xcode installed and a copy of Xamarin.iOS (you can use the free download version from www.xamarin.com). If you're using a PC, you'll need to be running Windows 7. It will need a Mac somewhere on the network to deploy and use Xcode from.
An iPhone or iPad is also useful.
This book is for those who already code in C#; it is the basic assumption used. You need not have ever written anything for a mobile device or have coded in Objective C. If you're interested in developing code for iOS, then you're in the right place.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: "A UIImageView
has no events attached to it, so if you need an image that can be clicked on, they can be planted onto a UIButton
class "
A block of code is set as follows:
var r = new UIButton(); r.Frame = new RectangleF(0, 0, 100f, 100f);// button 100 x 100 at 0, 0 var i = new UIImageView(new RectangleF(15f, 2f, 70f, 70f)); i.Image = UIImage.FromFile("path/toimage.png")Scale(new SizeF(70f, 70f)); var l = new UILabel(new RectangleF(2f, 78f, 96f, 20f)); l.Text = "Hello world"; r.AddSubview(i); r.AddSubview(l);
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "The class needs to be defined in the connector as both an outlet and action (with the Event selected to be Value Changed)."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title via 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 on www.packtpub.com/authors.
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.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. 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.
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 would 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 on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright 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.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.