 }
 
 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?

        tableView.tableFooterView?.hidden = true
        tableView.scrollEnabled = false
        tableView.rowHeight = 50
        
        moduleSelectorViewTitle.text = NSLocalizedString("module selector title", comment: "module selector view title")
    }
    
    func addHeadline() {
        addTextModule(UIFontTextStyleHeadline)
    }
    
    func addSubheadline() {
        addTextModule(UIFontTextStyleSubheadline)
    }

    func addBody() {
        addTextModule(UIFontTextStyleBody)
    }
    
    @IBAction func closeButtonAction(sender: UIButton) {


    func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        
//        switch indexPath.row {
//        case 0:
//            addHeadline()
//        case 1:
//            addSubheadline()
//        case 2:
//            addBody()
//        case 3:
//            addImage()
//        default:
//            addBody()
//        }
//        dismissViewControllerAnimated(true, completion: { () -> Void in
//
//        })
    }

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