Skip to content

Instantly share code, notes, and snippets.

@martinbowling
martinbowling / .gitignore
Created December 14, 2011 20:20 — forked from rpetrich/.gitignore
Replace codesigning in iOS apps and generate IPA files. By design, does not work with encrypted apps
embedded.mobileprovision
@martinbowling
martinbowling / gist:1420182
Created December 1, 2011 21:54
Grab UIViewController from UITableView
var pt = (this.View.Superview.Superview.Superview.Superview.Superview.Superview as UITableView);
var nav = (pt.NextResponder as DialogViewController);
nav.NavigationController.PushViewController(dvc,true);
@martinbowling
martinbowling / NotificationBar
Created November 29, 2011 00:06 — forked from Clancey/NotificationBar
NotificationBar
using System;
using ClanceysLib;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Threading;
using MonoTouch.ObjCRuntime;
using System.Drawing;
using MonoTouch.CoreGraphics;
using System.Linq;
namespace Collaborate
@martinbowling
martinbowling / scale.cs
Created November 11, 2011 17:40 — forked from nicwise/scale.cs
Scale and Rotate an image in iOS / MonoTouch, using the EXIF data
public static UIImage ScaleImage(UIImage image, int maxSize)
{
UIImage res;
using (CGImage imageRef = image.CGImage)
{
CGImageAlphaInfo alphaInfo = imageRef.AlphaInfo;
CGColorSpace colorSpaceInfo = CGColorSpace.CreateDeviceRGB();
if (alphaInfo == CGImageAlphaInfo.None)
@martinbowling
martinbowling / gist:1245622
Created September 27, 2011 17:03
Example Usage of CustomNavBackButton
var n = NavigationController as UICustomNavigationController;
backButton = new CustomNavBarBackButton(UIImage.FromBundle("Images/navigationBarBackButton.png"), title, delegate{
NavigationController.PopViewControllerAnimated(true);
});
UIBarButtonItem bb = new UIBarButtonItem(backButton);
@martinbowling
martinbowling / gist:1245619
Created September 27, 2011 17:01
CustomNavButton & CustomNavBackButton
public class CustomNavBarBackButton : UIButton
{
private const float MAX_WIDTH = 160.0f;
private const int CapWidth = 14;
UIImage buttonImage;
string buttonTitle;
public event NSAction Tapped;
@martinbowling
martinbowling / CustomNavButton.cs
Created September 27, 2011 16:58
CustomNavButton
using System;
using System.Drawing;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.ObjCRuntime;
namespace SWVCVB
{
using System;
using ClanceysLib;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using System.Threading;
using MonoTouch.ObjCRuntime;
using System.Drawing;
using MonoTouch.CoreGraphics;
using System.Linq;
namespace Collaborate
@martinbowling
martinbowling / gist:1233161
Created September 21, 2011 20:17 — forked from Clancey/gist:1047006
MapView With MKPolyLines For route
using System;
using MonoTouch.UIKit;
using System.Collections.Generic;
using MonoTouch.MapKit;
using System.Threading;
using ClanceysLib;
using MonoTouch.Foundation;
using System.Linq;
using MonoTouch.CoreLocation;
using System.Drawing;
@martinbowling
martinbowling / AnimationService.cs
Created April 29, 2011 01:00 — forked from follesoe/AnimationService.cs
MonoTouch animation helper by @alex_york and @follesoe
public static class AnimationService
{
public static void FadeOut(this UIView view, float duration = 1.0f, float opacity = 0.0f)
{
Animate(duration, () => {
view.Layer.Opacity = opacity;
});
}
public static void Animate(double duration, Action block)