'use strict';
var UITextAutocorrectionType = ["default", "no", "yes"]
function dumpUIText(view) {
if (!view) {
view = ObjC.classes.UIWindow.keyWindow();
}
var subviews = view.subviews();
var count = subviews.count();
for (var i = 0; i < count; i++) {
var x = subviews.objectAtIndex_(i);
if (x.isKindOfClass_(ObjC.classes.UITextField) || x.isKindOfClass_(ObjC.classes.UITextView)) {
console.log("<" + x.$className + ": " + x.handle + ">");
console.log(" autocorrectionType: " + UITextAutocorrectionType[x.autocorrectionType()]);
if (x.text() != "") {
console.log(" content: " + x.text());
}
} else if (x.isKindOfClass_(ObjC.classes.UITextFieldLabel)) {
console.log(" Label: " + x.text());
}
dumpUIText(x);
}
}