 for os in OS.allValues {
     var storyboardsForOS = storyboardFiles.filter { $0.os == os }
     if !storyboardsForOS.isEmpty {
-        if storyboardsForOS.count != storyboardFiles.count { println("#if os(\(os.rawValue))") }
+        
+        if storyboardsForOS.count != storyboardFiles.count {
+            println("#if os(\(os.rawValue))")
+        }
+        
         processStoryboards(storyboardsForOS, os)
-        if storyboardsForOS.count != storyboardFiles.count { println("#endif") }
-    }
-}
+        
+        if storyboardsForOS.count != storyboardFiles.count {
+            println("#endif")
+        }
+    }
+}

}


//MARK: Functions Storyboards

func findStoryboards(rootPath: String, suffix: String) -> [String]? {
    var result = Array<String>()

    
    lazy var os:OS = self.initOS() ?? OS.iOS
    private func initOS() -> OS? {
        if let targetRuntime = self.xml?["document"].element?.attributes["targetRuntime"] {
            return OS(targetRuntime: targetRuntime)
        }
        return nil
    }
