 	}
 	
 	func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) {
-		// TODO: Add this method's implementation
+		
+		if let mapCell = cell as? DestinationMapCell,
+			let locationCoordinate = viewModel?.locationCoordinate {
+			
+			mapCell.configure(coordinate: locationCoordinate)
+			return
+		}
+		
+		
+		guard let infoCell = cell as? DestinationInfoCell,
+			let locationInfo = viewModel?.locationInfo
+			where indexPath.row <= locationInfo.count else {
+				return
+		}
+		
+		let infoRow = indexPath.row - 1
+		let infoTypes = Array(locationInfo.keys)
+		
+		let infoType = infoTypes[infoRow]
+		let infoText = locationInfo[infoType]
+		
+		infoCell.configure(infoType: infoType, infoText: infoText)
 	}
 }
	
	func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
		
		guard let row = Row(rawValue: indexPath.row) else {
			return CGFloat.min
		}
		
		switch row {
		case .Map: return DestinationMapCell.preferredHeight()
		}
	}
	
	


import Foundation
import CascadingTableDelegate
import CoreLocation

protocol DestinationInfoSectionViewModel: class {
	
	/// Stores location coordinate.
	var locationCoordinate: CLLocationCoordinate2D? { get }
	
	/// Stores `Dictionary` of `String`s of the location info, where the `key` is the human-readable info type, and the `value` is human-readable info text.
	var locationInfo: [String: String] { get }
	
	/// Executed when any property info of this instance is updated.
	var infoDataChanged: (Void -> Void)? { get set }
}

class DestinationInfoSectionDelegate: NSObject {
	
	var index: Int
	var childDelegates: [CascadingTableDelegate]
	weak var parentDelegate: CascadingTableDelegate?
	
	var viewModel: DestinationInfoSectionViewModel? {
		didSet {
			configureViewModelObserver()
		}
	}
	
	private weak var currentTableView: UITableView?
	
	convenience init(viewModel: DestinationInfoSectionViewModel? = nil) {
		self.init(index: 0, childDelegates: [])
		self.viewModel = viewModel
		configureViewModelObserver()
	}
	
	required init(index: Int, childDelegates: [CascadingTableDelegate]) {
		self.index = index
		self.childDelegates = childDelegates
	}
	
	// MARK: - Private methods
	
	private func configureViewModelObserver() {
		
		viewModel?.infoDataChanged = { [weak self] in
			self?.currentTableView?.reloadData()
		}
	}
	
	
	private func identifierForRow(row: Int) -> String? {
		
		if row == 0 {
			return DestinationMapCell.nibIdentifier()
		}
		
		if let viewModel = viewModel where row <= viewModel.locationInfo.count {
			return DestinationInfoCell.nibIdentifier()
		}
		
		return nil
	}
}

extension DestinationInfoSectionDelegate: CascadingTableDelegate {
	
	func prepare(tableView tableView: UITableView) {
		currentTableView = tableView
		registerNibs(tableView: tableView)
	}
	
	private func registerNibs(tableView tableView: UITableView) {
		
		[ DestinationMapCell.nibIdentifier(), DestinationInfoCell.nibIdentifier() ]
		.forEach { identifier in
				
				let nib = UINib(nibName: identifier, bundle: nil)
				tableView.registerNib(nib, forCellReuseIdentifier: identifier)
		}
	}
}
