Application Fundamentals

Common Patterns and Idioms

Throughout the Apple APIs exposed via C#, certain idioms and patterns come up over and over again. If you have experience with programming with Xamarin.iOS, these may look familiar. Documentation will often refer to these patterns and idioms repeatedly, so having a solid understanding of them will help you make sense of the documentation you find.

Understanding Mac APIs

For much of your time developing with Xamarin.Mac, you can think, read, and write in C# without much concern with the underlying Objective-C APIs. However, sometimes you’ll need to read the API documentation from Apple, translate an answer from Stack Overflow to a solution for your problem, or compare to an existing sample.

Working with .xib Files

This article covers working with with .xib files created in Xcode's Interface Builder to create and maintain user interfaces for a Xamarin.Mac Application.

.storyboard/.xib Less User Interface Design

This article covers creating a Xamarin.Mac Application's User Interface directly from C# code without using Xcode's Interface Builder with .storyboard or .xib files.

Working with Images

This article covers working with Images and Icons in a Xamarin.Mac application. It covers creating and maintaining the images needed to create your application's Icon and using Images in both C# code and Xcode's Interface Builder.

Data Binding and Key-Value Coding

This article covers using Key-Value Coding and Key-Value Observing to allow for Data Binding to UI Elements in Xcode's Interface Builder. Using this technique, you greatly reduce the amount of C# code that needs to be written for your Xamarin.Mac application.

Working with Databases

This article covers using Key-Value Coding and Key-Value Observing to allow for Data Binding with direct access to SQLite databases to UI Elements in Xcode's Interface Builder. It also covers using the SQLite.NET ORM to provide access to SQLite data.

Working with Copy and Paste

This article covers working with the Pasteboard to provide Copy and Paste in a Xamarin.Mac application. It shows how to work with standard data types that can be shared between multiple apps and how to support custom data within a give app.

Sandboxing a Xamarin.Mac App

This article covers sandboxing a Xamarin.Mac application for release on the App Store. It covers all of the elements that go into sandboxing: container directories, entitlements, user-determined permissions, privilege separation, and kernel enforcement.

Playing Sound with AVAudioPlayer

This article shows how to use a helper class to control the playback of sound using an AVAudioPlayer.

Reporting Bugs

Sometimes we all get stuck while working on a project, either on the inability to get an API to work the way we want or in trying to work around a bug. Our goal at Xamarin is for you to be successful in writing your mobile and desktop applications, and we’ve provided some resources to help.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.