 final class Message {
     
     let text: String
-    let date: NSDate
-    let cell: Cell
-    let name: String
+    let date: Date
+    let position: Position
     
-    init(cell: Cell, date: NSDate, text: String, name: String) {
+    init(position: Position, date: Date, text: String) {
         self.text = text
-        self.cell = cell
+        self.position = position
         self.date = date
-        self.name = name
     }
     
 }

    
    override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> RevealableTableViewCell {
        let message = messages[indexPath.item]
        let cell = tableView.dequeueReusableCell(withIdentifier: message.cell.rawValue, for: indexPath as IndexPath) as! TableViewCell
        configure(cell: cell, at: indexPath, with: message)
        return cell
    }
    
    override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
        return 49
    }
    
    override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        let message = messages[indexPath.item]
        
        if let cell = tableView.dequeueReusableCell(withIdentifier: message.cell.rawValue) as? TableViewCell {
            configure(cell: cell, at: indexPath, with: message)
            return cell.contentView.systemLayoutSizeFitting(UIView.layoutFittingExpandedSize).height
        }
        
        return 50
    }
    
    override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
        return "Today"
    }
    
    override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

import LoremIpsum
import RevealableCell

enum Position: String {
    case left = "leftAlignedCell"
    case right = "rightAlignedCell"
}

class ViewController: UITableViewController {

    var messages = [Message]()
    
    func configure(cell: TableViewCell, at indexPath: IndexPath, with message: Message) {
        
