Skip to content

Instantly share code, notes, and snippets.

@praeclarum
praeclarum / ObservableTableViewController.cs
Created April 7, 2014 16:57
This is my UITableViewController with DataSource property that listens for INotifyCollectionChanged
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Diagnostics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace Praeclarum.UI
{
@jamesmontemagno
jamesmontemagno / IRemove.cs
Last active November 16, 2021 08:46
A simple and Intuitive Xamarin.iOS + MvvmCross TableView swipe to delete implementation. This will allow you to have any number of ViewModels simply implement IRemove.cs and all you need is MvxDeleteStandarTableViewSource and implement the interface in your viewmodels! I should say that these are edited classes, you should implement some of the …
public interface IRemove
{
ICommand RemoveCommand { get; }
}
@drance
drance / UIViewController+BHSContainment.m
Last active September 2, 2021 00:26
Tired of the UIViewController containment three-step. Adds a convenience param if the destination superview is not actually the parent VC's main view.
@implementation UIViewController (BHSContainment)
- (void)bhs_addChildViewController:(UIViewController *)child {
[self bhs_addChildViewController:child superview:self.view];
}
// Note this potentially forces view loads on both parent and child
// Not a problem if used in -viewDidLoad or later
// Use superview parameter with care. If it's not within the parent VC's hierarchy, you deserve to lose
@praeclarum
praeclarum / Layout.cs
Created March 16, 2013 05:23
A C# syntax for NSLayoutConstraints.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using MonoTouch.UIKit;
namespace Async.iOS
{
public static class Layout
{
@praeclarum
praeclarum / AppDelegate.cs
Created December 5, 2012 00:45
Code used to measure the network performance of an iPhone 5 while traveling around Seattle
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading;
using MonoTouch.Foundation;
using MonoTouch.UIKit;