     
     func addRecipients(addedRecipients: [Recipient]) {
         self.recipients = addedRecipients
-        tableView.reloadData()
     }
     
     @IBAction func didTapSendButton(sender: AnyObject) {


import UIKit

class PreviewViewController: UIViewController, RecipientsViewControllerDelegate {
    
    var recipients = [Recipient]()
    var modules = [ComposerModule]()

    @IBOutlet weak var recipientsLabel: UILabel!
    @IBOutlet weak var tableView: UITableView!
    @IBOutlet weak var webView: UIWebView!
    @IBOutlet weak var addRecipientsButton: UIButton!
    @IBOutlet weak var recipientsTableHeaderLabel: UILabel!
    @IBOutlet weak var previewTableHeaderLabel: UILabel!
    @IBOutlet weak var topSpaceToTableViewConstraint: NSLayoutConstraint!

    // the selected digipost address for the mailbox that should show as sender when sending current compsing letter
    var mailboxDigipostAddress : String?


    override func viewDidLoad() {
        super.viewDidLoad()
        webView.delegate = self
        webView.scrollView.scrollEnabled = false
        
        ComposerModuleParser.parseComposerModuleContentToHTML(modules, response: { [unowned self] (htmlString) -> ()  in
            self.webView.loadHTMLString(htmlString, baseURL: nil)
            self.currentShowingHTMLContent = htmlString!
            
            })
        
        self.title = NSLocalizedString("preview view navigation bar title", comment: "Navigation bar title in preview view")
        
    }
    
    func webViewDidFinishLoad(webView: UIWebView) {
        self.scrollView.contentSize = CGSize(width: self.scrollView.frame.width, height: self.webView.scrollView.contentSize.height + 300)
        webViewHeightConstraint.constant = self.webView.scrollView.contentSize.height
    }
    
    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
                
        
        if recipients.count > 0 {
            recipientsHeaderLabel.text = NSLocalizedString("preview view recipients header title no recipients", comment: "Recipients view header no recipients")
        } else if recipients.count == 1 {
            recipientsHeaderLabel.text = NSLocalizedString("preview view recipients header title one recipient", comment: "Recipients view header one recipient")
        } else {
            let localizedString = NSLocalizedString("preview view recipients header title recipients", comment: "Recipients view header many recipients")
            recipientsHeaderLabel.text = "\(recipients.count) \(localizedString)"
        }
        
        previewHeaderLabel.text = NSLocalizedString("preview view header title", comment: "Preview view header")
    
    }
    
