 	}
 	
 	public func objectForId<T>(id:String) -> T? {
-		if let foundObj = idMappings[id] as? T {
-			return foundObj
-		}
-		return nil
+        guard let foundObj = idMappings[id] as? T else { return nil }
+        return foundObj
 	}
 	
 }

	}
	
	func searchXMLObject(xmlObj:Object) {
		xmlObj.visit({ [unowned self] (element:GaxbElement) -> () in
			
			if let xmlController = element as? Controller {
				xmlController.controllerObject = self
			}
			
			if let xmlObject = element as? Object {
				
				if xmlObject.id != nil {
					self.idMappings[xmlObject.id!] = xmlObject
				}
			}
		})
	}
    
    public func decorate(element: GaxbElement) {
        //Override decorate in your controller class if you need a handle on the XML views from your PlanetView
    }
	
	func searchForPlanetView(searchedView:UIView) {

	
    public var planetViews = Array<PlanetView>()
	var idMappings = Dictionary<String, Object>()
	@IBInspectable var titleBundlePath: String?
    public var mainBundlePath: String?
    
    var titleXmlView: View?
	
	public override func loadView() {
		super.loadView()
		
        navigationItem.title = self.title
		
		if let titleBundlePath = titleBundlePath, titleXmlView = PlanetUI.readFromFile(String(bundlePath: titleBundlePath)) as? View {
            navigationItem.titleView = titleXmlView.view
            titleXmlView.visit { $0.gaxbDidPrepare() }
            searchXMLObject(titleXmlView)
		}
		
        if let mainBundlePath = mainBundlePath, mainXmlView = PlanetUI.readFromFile(String(bundlePath: mainBundlePath)) as? View {
            view.addSubview(mainXmlView.view)
            mainXmlView.visit { $0.gaxbDidPrepare() }
            searchXMLObject(mainXmlView)
        }
        
		// Overriding loadView because we need a function where the view exists
        // but child view controllers have not been loaded yet
		searchForPlanetView(view)
		for planetView in planetViews {
			if let xmlObj = planetView.xmlView {
				searchXMLObject(xmlObj)
