 }
 
 class ModuleSelectorViewController: UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UITableViewDelegate, UITableViewDataSource {
+
+    var textAttributes : [TextAttribute]
+
+    required init(coder aDecoder: NSCoder) {
+        self.textAttributes = [TextAttribute]()
+        super.init(coder: aDecoder)
+    }
+
+    class func setup(#textAttributes: [TextAttribute]) -> ModuleSelectorViewController {
+        let moduleSelectorViewController = UIStoryboard(name: "DocumentComposer", bundle: NSBundle.mainBundle()).instantiateViewControllerWithIdentifier("moduleSelectorViewController") as! ModuleSelectorViewController
+        moduleSelectorViewController.textAttributes = textAttributes
+        return moduleSelectorViewController
+    }
 
     var imagePicker = UIImagePickerController()
     var delegate: ModuleSelectorViewControllerDelegate?


    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        
        switch indexPath.row {
        case 0:
            addHeadline()
        case 1:
            addSubheadline()
        case 2:
            addBody()
        case 3:
            addImage()
        default:
            addBody()
        }
    }

    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

        return cell
    }
    
//    override func touchesEnded(touches: Set<NSObject>, withEvent event: UIEvent) {

//        for touch: AnyObject in touches {
//            let location = touch.locationInView(moduleSelectorView)
//            if moduleSelectorView.pointInside(location, withEvent: event) == false{
//                self.delegate?.moduleSelectorViewControllerWasDismissed(self)
//            }
//            
//        }
//    }

}
