Lists in Xamarin Watch

Intro

There is documentation and a sample on Xamarin.com to show how to add lists to a Watch application, but it can be a bit confusing, so I created a very simple example that we can walk through line by line.

To get started, reate a new single page iOS application; let’s call it WatchRowsDemo

Fill in the program name, etc. And when the app is created, click on solution and choose Add New Project. In the New Project window click on Extension and WatchKit App.

Click your way through and once done you will have three projects:

  • WatchRowsDemo
  • WatchRowsDemoWatchKitApp  
  • WatchRowsDemoWatchKitExtension.  

It is important to keep these three straight:  WatchRowsDemo is the parent or main application.  WatchRowsDemoWatchKitApp is the UI for your watch application, while WatchRowsDemoWatchKitExtension is where the logic for you watch application resides.

A key concept to remember is

  • your UI (storyboards) go in …WatchKitApp 
  • your logic (controllers) go in …WatchKitExtension.

Your application is born with Interface.storyboard and InterfaceController.

Continued here

About Jesse Liberty

Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen online courses. His latest book, Building APIs with .NET will be released early in 2025. Liberty is a Senior SW Engineer for CNH and he was a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Microsoft MVP.
This entry was posted in Essentials and tagged , , . Bookmark the permalink.