Created
July 21, 2012 15:14
-
-
Save KennyGoers/3156085 to your computer and use it in GitHub Desktop.
A VERY useful extension method for MonoTouch to dump a view stack to a log or console, you can supply the UIApplication.SharedApplication.KeyWindow even for a full view dump, this is an undocumented iOS selector, but generally used for debugging anyway.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MonoTouch.Foundation; | |
using MonoTouch.ObjCRuntime; | |
using MonoTouch.UIKit; | |
namespace NS { | |
public static class UIViewExtensions { | |
// returns the view and all child views with status | |
public static string RecursiveDescription(this UIView view) | |
{ | |
return new NSString(Messaging.IntPtr_objc_msgSend(view.Handle, new Selector("recursiveDescription").Handle)).ToString(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment