Line Diet is Back - and Open Source!

Get it now, or check out the project on Github

Back in July of 2013 I released an app called Line Diet for iPhone written using Xamarin.iOS. A few years later an iOS update broke my custom implementation of entering a weight, so the app stopped working (as I had no time to fix it), and I pulled it from the App Store. Since then I've intended on re-releasing it (and even had a personal version with nearly complete Apple Watch support), but since this was more of a personal interest app, and not one that was generating revenue, it sat on the back-burner for the last year or two.

Today I'm happy to announce that not only is Line Diet back, but it is now available for both iOS and Android. On top of that, it is now an open source project on Github. It is written in C# and XAML using Xamarin.Forms, Prism, and OxyPlot. While the app is pretty straight forward, it has some pretty neat features as well (dynamic color theming, MVVM architecture, graphing, etc.). My hope is that it serves as a good sample app for folks looking to learn MVVM based mobile app development using C#, Xamarin.Forms, and Prism. It has plenty of potential extension points as well, so feel free to submit a pull request if you have interest in adding to the project.

You can find out more about Line Diet and find relative app store download links at LineDietApp.com.

Using Custom Unwind Segues with Xamarin.iOS

As you probably know by now, I'm a huge advocate for Xamarin technologies for native iOS and Android apps. After trying to implement some custom unwind segues for an iPad app, I discovered that no-one had documented how to do them using Xamarin.iOS yet, so I wanted to throw something together to hopefully save others time down the road.

I've created a Github repo at the link below which includes two sample projects. One sample project shows custom segues and custom unwind segues within a UINavigationController, and the other sample shows how to do custom segues without a navigation controller. The second sample is largely ported from this article.

Xamarin Custom Segue Samples - Github

I also recorded a 15 minute screencast showing how to do it all, you can find that here:
Xamarin Custom Unwind Segue Screencast - YouTube

Also, folks are frequently curious what C# code written in Xamarin.iOS looks like as compared to Objective-C, so below are two custom segues - the first in Obj-C (from the source link above), and the ported C# that does the same thing:


@implementation CustomUnwindSegue
- (void)perform {
    UIViewController *sourceViewController = self.sourceViewController;
    UIViewController *destinationViewController = self.destinationViewController;
    // Add view to super view temporarily
    [sourceViewController.view.superview insertSubview:destinationViewController.view atIndex:0];
    [UIView animateWithDuration:0.5
                // Shrink!
                sourceViewController.view.transform = CGAffineTransformMakeScale(0.05, 0.05);
                sourceViewController.view.center = self.targetPoint;
            completion:^(BOOL finished){
                [destinationViewController.view removeFromSuperview]; // remove from temp super view
                [sourceViewController dismissViewControllerAnimated:NO completion:NULL]; // dismiss VC


public override void Perform()
    // Add view to super view temporarily
    SourceViewController.View.Superview.InsertSubview(DestinationViewController.View, 0);

    UIView.Animate(0.5f, 0.0f, UIViewAnimationOptions.CurveEaseInOut, 
        () => {
            SourceViewController.View.Transform = CGAffineTransform.MakeScale(0.05f, 0.05f);
            SourceViewController.View.Center = this.TargetPoint;
        () => {
            SourceViewController.DismissViewController(false, null);