Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public static UIImage[] GetImagesIOS6 (UIPasteboard pasteboard)
global::MonoTouch.UIKit.UIApplication.EnsureUIThread ();
if (pasteboard == null)
throw new ArgumentNullException ("pasteboard");
var arrayptr = global::MonoTouch.ObjCRuntime.Messaging.IntPtr_objc_msgSend (pasteboard.Handle, new global::MonoTouch.ObjCRuntime.Selector ("images").Handle);
if (arrayptr == IntPtr.Zero)
return null;
var array = new NSArray (arrayptr);
var ret = new UIImage [array.Count];
for (uint i = 0; i < ret.Length; i++) {
var obj = global::MonoTouch.ObjCRuntime.Runtime.GetNSObject (array.ValueAt (i));
var data = obj as NSData;
UIImage img;
if (data != null) {
img = new UIImage (data);
} else {
img = (UIImage) obj;
ret [i] = img;
return ret;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment