
registerType('appdoo.iOS', (function () { function UIViewController() {} var __super = setSupertypeFromDomain(UIViewController, 'BasicObject', 'Core');

	Object.defineProperty(UIViewController.prototype, "view", {
	synthesized: true, get:function () { return this._view; }, set:function (v) {if (!Object.hasOwnProperty(this, "_view")) Object.defineProperty(this, "_view", { writable: true, configurable: true }); this._view = v; }});
	

	
	Object.defineProperty(UIViewController.prototype, "viewData", {
	outlet: true, 
	enumerable: true, get:function () { return this._viewData; }, set:function (v) {if (!Object.hasOwnProperty(this, "_viewData")) Object.defineProperty(this, "_viewData", { writable: true, configurable: true }); this._viewData = v; }});
	

	Object.defineProperty(UIViewController.prototype, "title", {
	outlet: true, 
	enumerable: true, get:function () { return this._title; }, set:function (v) {if (!Object.hasOwnProperty(this, "_title")) Object.defineProperty(this, "_title", { writable: true, configurable: true }); this._title = v; }});
	


	

	Object.defineProperty(UIViewController.prototype, "tabBarController", {
	outlet: true, 
	referenced: true, get:function () { return this._tabBarController; }, set:function (v) {if (!Object.hasOwnProperty(this, "_tabBarController")) Object.defineProperty(this, "_tabBarController", { writable: true, configurable: true }); this._tabBarController = v; }});
	

	Object.defineProperty(UIViewController.prototype, "navigationController", {
	outlet: true, 
	referenced: true, get:function () { return this._navigationController; }, set:function (v) {if (!Object.hasOwnProperty(this, "_navigationController")) Object.defineProperty(this, "_navigationController", { writable: true, configurable: true }); this._navigationController = v; }});
	


	

	Object.defineProperty(UIViewController.prototype, "navigationItem", {
	outlet: true, 
	referenced: true, get:function () { return this._navigationItem; }, set:function (v) {if (!Object.hasOwnProperty(this, "_navigationItem")) Object.defineProperty(this, "_navigationItem", { writable: true, configurable: true }); this._navigationItem = v; }});
	

	Object.defineProperty(UIViewController.prototype, "tabBarItem", {
	outlet: true, 
	enumerable: true, get:function () { return this._tabBarItem; }, set:function (v) {if (!Object.hasOwnProperty(this, "_tabBarItem")) Object.defineProperty(this, "_tabBarItem", { writable: true, configurable: true }); this._tabBarItem = v; }});
	
		
	Object.defineProperty(UIViewController.prototype, "$objects", {
	outlet: true, 
	enumerable: true, get:function () { return this._$objects; }, set:function (v) {if (!Object.hasOwnProperty(this, "_$objects")) Object.defineProperty(this, "_$objects", { writable: true, configurable: true }); this._$objects = v; }});
	
	
	Object.defineProperty(UIViewController.prototype, "$methods", {
	outlet: true, 
	enumerable: true, get:function () { return this._$methods; }, set:function (v) {if (!Object.hasOwnProperty(this, "_$methods")) Object.defineProperty(this, "_$methods", { writable: true, configurable: true }); this._$methods = v; }});
	
	
	
UIViewController.prototype.loadView = function UIViewController_loadView() {
		if (this.view) return;
		this.view = this.context.decodeObjectTree(this.viewData);
		if (this.view)
			this.view.viewDidLoad();
		else {
			console.error('The view could not be created.', this.view, this);
			console.trace();
		}};
	

UIViewController.prototype.unloadView = function UIViewController_unloadView() {
		if (!this.view) return;
		this.view = null;};
	

UIViewController.prototype.saveView = function UIViewController_saveView() {
		if (this.view)
			this.viewData = this.view.encode();};
	
	
UIViewController.prototype.transformData = function UIViewController_transformData(data, transformer) {
	
		if (transformer.isXIBGenerator) {
			return transformer.createObject(data);
		}

		var result = {
			$type: 'PrototypeViewController',
			$domain: this.__domain,
			$id: data.$id,
			title: data.title,
			$connections: [],
		};
		
		transformer.currentViewController = result;
		transformer.currentViewControllerData = data;

		var proto = getPrototype(utiFromData(data.viewData));

		if (proto && proto.transformData) {
			result.$viewData = proto.transformData(data.viewData, transformer);
		}
			
		if (data.tabBarItem)
			result.tabBarItem = getPrototype(utiFromData(data.tabBarItem)).transformData(data.tabBarItem, transformer);
		
		return result;};
	

UIViewController.prototype.initPropertiesFromData = function UIViewController_initPropertiesFromData(data) {
try { __super.prototype.initPropertiesFromData.call(this, data); } catch (err) {}
if (data.hasOwnProperty("viewData")) this.viewData = data.viewData;
if (data.hasOwnProperty("title")) this.title = data.title;
if (data.hasOwnProperty("tabBarController")) this.tabBarController = data.tabBarController;
if (data.hasOwnProperty("navigationController")) this.navigationController = data.navigationController;
if (data.hasOwnProperty("navigationItem")) this.navigationItem = data.navigationItem;
if (data.hasOwnProperty("tabBarItem")) this.tabBarItem = data.tabBarItem;
if (data.hasOwnProperty("$objects")) this.$objects = data.$objects;
if (data.hasOwnProperty("$methods")) this.$methods = data.$methods;
};

UIViewController.prototype.decodeData = function UIViewController_decodeData(data) { var decoded;
try { decoded = __super.prototype.decodeData.call(this, data); } catch (err) { console.warn(err); decoded = clone(data); }
if (data.hasOwnProperty("tabBarItem")) decoded.tabBarItem = this.context.decodeObjectTree(data.tabBarItem);
if (data.hasOwnProperty("$objects")) decoded.$objects = []; if (Array.isArray(data.$objects)) { data.$objects.forEach(function (o) { decoded.$objects.push(this.context.decodeObjectTree(o)); }.bind(this)); }
return decoded; };

UIViewController.prototype.encode = function UIViewController_encode() { var encoded;
try { encoded = __super.prototype.encode.call(this); } catch (err) { console.warn(err); encoded = this.context.encodeObject(this); }
if (this._tabBarItem && this._tabBarItem.encode) {encoded.tabBarItem = this.tabBarItem.encode();
}if (this._$objects && this._$objects.encode) {encoded.$objects = []; this._$objects.forEach(function (o) { encoded.$objects.push(o.encode()); });
}return encoded; };

UIViewController.prototype.encodeCloned = function UIViewController_encodeCloned() { var encoded;
try { encoded = __super.prototype.encodeCloned.call(this); } catch (err) { console.warn(err); encoded = {}; }
if (this._tabBarItem && this._tabBarItem.encode) {encoded.tabBarItem = this.tabBarItem.encodeCloned();
}if (this._$objects && this._$objects.encode) {encoded.$objects = []; this._$objects.forEach(function (o) { encoded.$objects.push(o.encodeCloned()); });
}return encoded; };

UIViewController.prototype.expectedTypeForProperty = function UIViewController_expectedTypeForProperty(key) {
	if (key === "view") return "appdoo.iOS.UIView";
	if (key === "viewData") return "Object";
	if (key === "title") return "String";
	if (key === "tabBarController") return "appdoo.iOS.UITabBarController";
	if (key === "navigationController") return "appdoo.iOS.UINavigationController";
	if (key === "navigationItem") return "appdoo.iOS.UINavigationItem";
	if (key === "tabBarItem") return "appdoo.iOS.UITabBarItem";
	if (key === "$objects") return "BasicObject[]";
	if (key === "$methods") return "";
	if (__super) return __super.prototype.expectedTypeForProperty(key);
};

return UIViewController; }()));