Using MVVM with tables and cells in iOS

When I ventured into native iOS development I immediately took a look at the possibility to use data binding on iOS which enables me to simply declare the relationships between the UI and the ViewModel. This article takes that approach further shows you how to use MVVM and data binding when using tables and cells, or in the world of iOS UITableView and UITableViewCell.

Sample scenario

Let’s start with simple example scenario. You want to show progress of some flow that contains of multiple steps, each of the steps can be either running or complete. When a step is running it can report its progress. You want to display this flow in a table that looks like this

[Read More]

Using data binding in iOS

When I started working on a native iOS project after a few years of Windows (Phone) development I looked into ways to write a more declarative and more elegant code than the “standard” iOS way. I wanted to transfer some of my habits over and the first thing I really missed was XAML data binding. I did some research on how to do data binding in iOS and found a few libraries that make it possible. This allowed me to write better code and I think data binding is a concept that all the iOS developer should look into. If you are interested in my experience with using binding in iOS, read on.

Sample scenario

Let’s use a simple example scenario. You have a screen where the users have to choose their country and then enter their mobile number. The number has to be validated with respect to the selected country and if everything is ok the Next button should become visible. So basically it should work like this

[Read More]

A week with Microsoft Band 2

About a week ago I got a Microsoft Band 2. I really wanted to try out the device, because this second generation does not look as bad as the first one, there are new sensors added and generally it should be a visible improvement over the original Band. I have been an iPhone users for about two years now (approximately the time since last good Windows Phone device was released), currently using iPhone 6s so I was also curious to know how well the Band 2 works with iOS. This blog post sums up my impressions after a week of using the Microsoft Band 2 with my iPhone.

Expectations and habits

First I have to state that I am not a notifications junkie. I do not like being interrupted all the time. On my phone, only phone calls and SMS ale allowed to notify me with a sound and stay in the notifications center. Other few selected apps like Outlook, Twitter, Messenger, Sunrise are allowed to use iOS badges on my phone, just to let me know that there is a Twitter message or something I may be interested in. Other than that, no notifications for me. I guess I am not a typical user when it comes to notifications.

As you may have already guessed, I was interested in the Microsoft Band 2 primarily as a health device, not as a smartwatch or distractions device. My expectation and goal is to move and exercise more and sleep better, not to immediately know about every new Facebook post (I do not even have the Facebook app installed).

[Read More]

Using .NET libraries with MonoTouch

I have been playing with MonoTouch only for a few days when I already started to miss all the .NET libraries I commonly use. The first one I needed to get working with MonoTouch was JSON.NET.

MonoDevelop does not support Nuget so you have to get your libaries the old way. I downloaded JSON.NET package from Nuget.org, but it does not contain a DLL built for Mono. Harldy any Nuget package does. You can reference a DLL built for .NET, MonoDevelop will recognize it and even offer you IntelliSense but your project will not get built.

The right way to get a .NET library working with MonoTouch is downloading its source code and building it yourself. You can use MonoDevelop to build the source codes. The only think you have to do (at least for JSON.NET) is to change the .NET profile to an equivalent Mono profile in the project settings.

[Read More]

MonoTouch: iOS development for .NET programmers

Beeing quite disappointed with the Windows Phone platform recently I started to look for other ways to use my .NET skills and to develop for a mobile platform at the same time. I found MonoTouch, a product from Xamarin that allows you to build iOS apps using C# with Mono.

What is MonoTouch?

MonoTouch is a product or a framework do develop iOS apps using Mono (an open-source .NET implementation). It allows you to use C# (hopefuly also F# although I have not been able to get it to work yet) and all the .NET features libraries you use and like and of course your existing codebase. No Objective-C knowledge is required, but you will have to learn about the iOS ecosystem an iOS SDK. The iOS SDK is also needed, so you cannot do the development in Windows, you have to use a Mac. There are ways to get MacOS X working on a PC as a native install or in VMWare / VirtualBox, if you just want to try it out, but it may not be legal.

[Read More]