                 currentView = view
                 currentView?.parentView = parentView
                 if elementName == "imageView" {
-                    currentView?.usingAspectRatio = true
+                    let XMLattribute = NSXMLNode(kind: .AttributeKind)
+                    XMLattribute.name = "minimumScaleFactor"
+                    XMLattribute.stringValue = "0.5"
+                    currentNode.addAttribute(XMLattribute)
+                    if usingAspectRatioGlobal {
+                        currentView?.usingAspectRatio = true
+                    }
                 }
             }
         }

    var currentNode = NSXMLElement(name: "document")
    var outputXml: NSXMLDocument!
    var parser = NSXMLParser()
    
    let supportedViews = ["view", "imageView", "label", "button"]
    
    
    override func viewDidLoad() {
        super.viewDidLoad()
        outputXml = NSXMLDocument()
        outputXml.version = "1.0"
        outputXml.characterEncoding = "UTF-8"
        // Do any additional setup after loading the view.
    }

    override var representedObject: AnyObject? {
        didSet {
        // Update the view, if already loaded.
        }
    }
    
    private func beginParsing() {
        let filePath = "/Users/mcielecki/Code/storybots-ios/Storybots/Base.lproj/Test.storyboard"
        let xmlFile = NSData(contentsOfFile: filePath)
        parser = NSXMLParser(data: xmlFile!)
        parser.delegate = self

        
        //create file
        let fileManager = NSFileManager()
        fileManager.createFileAtPath(filePath, contents: prettyOutput.dataUsingEncoding(NSUTF8StringEncoding), attributes: nil)
    }
    
    @IBAction func generateLayoutButtonPressed(sender: AnyObject) {
