 
 import UIKit
 
-class ComposerViewController: UIViewController {
+extension UIImage{
+    
+    func resize(toSize size: CGSize, completionHandler: (resizedImage: UIImage, data: NSData) ->() ){
+        dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), { () -> Void in
+            UIGraphicsBeginImageContextWithOptions(size, false, 1.0)
+            self.drawInRect(CGRectMake(0, 0, size.width, size.height))
+            let resizedImage:UIImage = UIGraphicsGetImageFromCurrentImageContext()
+            UIGraphicsEndImageContext()
+            let imageData = UIImagePNGRepresentation(resizedImage)
+            dispatch_async(dispatch_get_main_queue(), { () -> Void in
+                completionHandler(resizedImage: resizedImage, data: imageData)
+            })
+        })
+    }
+}
+
+class ComposerViewController: UIViewController, ModuleSelectorViewControllerDelegate {
 
     @IBOutlet var tableView: UITableView!
     var tableViewDataSource: ComposerTableViewDataSource?

        tableView.rowHeight = UITableViewAutomaticDimension
        tableView.estimatedRowHeight = 44
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}


    override func viewDidLoad() {
        super.viewDidLoad()
        setupTableView()
    }
    
    // MARK: - TableView Setup
