Book Image

iOS Development with Xamarin Cookbook

By : Dimitrios Tavlikos (USD)
Book Image

iOS Development with Xamarin Cookbook

By: Dimitrios Tavlikos (USD)

Overview of this book

Table of Contents (22 chapters)
iOS Development with Xamarin Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

This book will provide you with all the necessary skills to develop and deploy rich and powerful applications for the iPhone and iPad, with the C# programming language. Xamarin.iOS, formerly known as MonoTouch, is already established as a powerful software development kit that brings iOS development to .NET programmers. Packed with easy-to-understand and detailed examples, this book will be your best companion in your iOS development journey.

What this book covers

Chapter 1, Development Tools, teaches you how to install and use the development tools necessary to create your first iOS app. From there, you will create and debug your first Xamarin.iOS project.

Chapter 2, User Interface – Views, discusses the essential User Interface components of the iOS SDK. Covering the most commonly used views and controls and many more in detail, we will get familiar with the platform through a number of example projects. We will also discuss the similarities and differences with standard .NET components.

Chapter 3, User Interface – View Controllers, introduces you to the view controllers, the objects that are responsible for providing the interaction mechanism between your app and the user. Explained with simple step-by-step processes, you will start creating complete apps that can run on both the iPhone and iPad devices.

Chapter 4, Data Management, covers data management practices available on the iOS platform and how to use them efficiently with the convenience of C#. You will learn to manage locale SQLite database files, but also work on using iCloud to store data across different devices.

Chapter 5, Displaying Data, focuses on another important part of data management. Through a series of simple and complete projects, you will learn about the available components to display data on the screen of the iPhone, which are smaller than computer screens. Displaying various types of data in a user-friendly manner is essential for mobile devices, and by the time you finish reading this chapter, you will certainly be more skillful in this area.

Chapter 6, Web Services, guides you through .NET SOAP, WCF, and REST services for creating apps that connect the user to the world. These powerful .NET features would not have been part of iOS development without Xamarin.iOS.

Chapter 7, Multimedia Resources, will teach you to create applications that capture, reproduce, and manage multimedia content through the device's hardware. You will not only learn to use the camera to capture images and video, but also learn how to play back and record audio.

Chapter 8, Integrating iOS Features, will walk you through the ways to incorporate the platform's native applications and components. You will learn how to provide e-mail, text messaging, and address book features in your application and how to use the native calendar to create events.

Chapter 9, Interacting with Device Hardware, discusses creating applications that are fully aware of their surrounding environment through the device's sensors. You will learn to adjust the User Interface according to device orientations and respond to accelerometer and gyroscope events.

Chapter 10, Location Services and Maps, is a detailed guide for using the built-in location services to create applications that provide location information to the user. You will not only learn to use the GPS hardware, but also how to display and layout information on maps.

Chapter 11, Graphics and Animation, introduces 2D graphics and animation. You will learn to animate components and draw simple graphics on the screen. By the end of this chapter, you will create a small finger-drawing application.

Chapter 12, Multitasking, will walk you through the details of implementing multitasking in iOS applications. This dramatically enhances the user experience by executing code behind the scenes.

Chapter 13, Localization, discusses how to provide localized content in applications. You will learn how to prepare your application to target users worldwide.

Chapter 14, Deploying, will not only walk you through the required steps to deploy your finished application to devices, but also to prepare and distribute it to the App Store.

Chapter 15, Advanced Features, introduces some of the key features introduced in newer iOS versions, such as implementing physics to User Interface components through the power of iOS 7's UIKit Dynamics, customizing animated transitions between view controllers, and more!

What you need for this book

The minimum requirement for this book is a Mac computer running at least Mac OS X Lion (10.7.*). Almost all projects you will create with the help of this book work on iOS Simulator. However, some projects will require a device to work properly. You will find all the appropriate details in Chapter 1, Development Tools.

Who this book is for

This book is essential for C# and .NET developers with no previous experience in iOS development, but it is also for Objective-C developers who want to make a transition to the benefits of Xamarin.iOS and C# language to create complete, compelling iPhone, iPod, and iPad applications and deploy them to the App Store.

Conventions

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, cookbook names, recipe names, scripts, database table names, folder names, filenames, file extensions, and pathnames are shown as follows: "The Register attribute is used to expose classes to the underlying Objective-C runtime."

A block of code is set as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

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

EKEvent newEvent = EKEvent.FromStore(evStore);
newEvent.StartDate = DateTime.Now.AddDays(1);
newEvent.EndDate = DateTime.Now.AddDays(1.1);
newEvent.Title = "Xamarin event!";

Any command-line input or output is written as follows:

cd <code_directory>/CH06_code/WcfService/WcfService
./start_wcfservice.sh

New terms and important words are shown in bold. Words you see on the screen, in menus or dialog boxes, for example, appear in the text like this: "Go to the Library pane and select Objects from the drop-down list."

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 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 , 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.

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 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.

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 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

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 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

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.