Skip to content

Instantly share code, notes, and snippets.

@mikebluestein
mikebluestein / EffectsController.cs
Created Jul 8, 2014
iOS 8 Visual Effects using Xamarin
View EffectsController.cs
using System;
using System.Drawing;
using MonoTouch.UIKit;
namespace ViewEffectsDemo
{
public class EffectsController : UIViewController
{
UIImageView imageView;
UIScrollView scrollView;
@mikebluestein
mikebluestein / gist:47ba7b7ca4ce65f36b41
Created Jul 28, 2014
UICollectionView using a UIViewController
View gist:47ba7b7ca4ce65f36b41
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace CollectionViewWithControllerDemo
{
public class Controller : UIViewController
{
CVSource source;
@mikebluestein
mikebluestein / HelloSceneKitController.cs
Last active Mar 4, 2020
A simple iOS 8 Scene Kit example using C# and Xamarin
View HelloSceneKitController.cs
using System;
using MonoTouch.UIKit;
using MonoTouch.SceneKit;
using MonoTouch.Foundation;
namespace HelloSceneKit
{
public class HelloSceneKitController : UIViewController
{
SCNView sceneView;
@mikebluestein
mikebluestein / main.dart
Created Jun 5, 2018
Flutter article source
View main.dart
import 'package:flutter/material.dart';
void main() {
runApp(
Container(
color: Colors.lightBlue,
child: Padding(
padding: const EdgeInsets.fromLTRB(0.0, 50.0, 0.0, 0.0),
child: Directionality(
View gist:e34ef9237619c09bcb7a
using System;
using MonoTouch.CoreImage;
using MonoTouch.UIKit;
namespace CIDetectorsDemo
{
public class DetectorController : UIViewController
{
UIImageView imageView;
@mikebluestein
mikebluestein / gist:8532580
Created Jan 21, 2014
Display a QR Code in Xamarin.iOS using Core Image
View gist:8532580
var qrCode = new CIQRCodeGenerator {
Message = NSData.FromString (someText),
CorrectionLevel = "Q"
}.OutputImage;
UIGraphics.BeginImageContext (new SizeF (qrCode.Extent.Width * 8, qrCode.Extent.Height * 8));
var cgCtx = UIGraphics.GetCurrentContext ();
var ciCtx = CIContext.FromOptions (null);
cgCtx.InterpolationQuality = CGInterpolationQuality.None;
cgCtx.DrawImage (cgCtx.GetClipBoundingBox (), ciCtx.CreateCGImage (qrCode, qrCode.Extent));
View gist:b784ab08889d83fb0a43
var imageView = new UIImageView ();
imageView.Frame = UIScreen.MainScreen.Bounds;
imageView.ContentMode = UIViewContentMode.ScaleAspectFit;
var qrCode = new CIQRCodeGenerator {
Message = NSData.FromString ("test"),
CorrectionLevel = "Q"
}.OutputImage;
UIGraphics.BeginImageContext (new SizeF (qrCode.Extent.Width * 8, qrCode.Extent.Height * 8));
@mikebluestein
mikebluestein / gist:8061285
Created Dec 20, 2013
NSAttributedString with HTML
View gist:8061285
NSError error = null;
var htmlString = new NSAttributedString (NSUrl.FromFilename (
"Test.html"),
new NSAttributedStringDocumentAttributes{ DocumentType = NSDocumentType.HTML },
ref error);
textView.AttributedText = htmlString;
View gist:7694724
NSError err;
ab = ABAddressBook.Create (out err);
if (err == null) {
ab.RequestAccess ((allowed, err1) => {
if (allowed) {
var people = ab.GetPeople ();
foreach (ABPerson person in people) {
View AutolayoutHelp.MD
public static class AutolayoutHelper
{
	[DllImport (Constants.ObjectiveCLibrary, EntryPoint = "objc_msgSend")]
	static extern IntPtr IntPtr_objc_msgSend (IntPtr receiver, IntPtr selector);

	public static void AutoLayoutTrace ()
	{
		var trace = Runtime.GetNSObject (IntPtr_objc_msgSend (UIApplication.SharedApplication.KeyWindow.Handle, new Selector ("_autolayoutTrace").Handle));