This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ChatBubbleTableViewCell.swift | |
// LufthansaServiceCenter | |
// | |
// Created by Nermin Sehic on 27/05/2018. | |
// Copyright © 2018 Lufthansa. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ModuleConnector { | |
weak var navigationController: UINavigationController? | |
init(navigationController: UINavigationController) { | |
self.navigationController = navigationController | |
} | |
func connect() { | |
let gateway = StaticDataGateway() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol UseCase { | |
func execute() -> String | |
} | |
class ShowDataUseCase: UseCase { | |
let gateway: DataGateway | |
init(dataGateway: DataGateway) { | |
self.gateway = dataGateway |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol DataGateway { | |
func getData() -> String | |
} | |
class StaticDataGateway: DataGateway { | |
func getData() -> String { | |
return "Important Data" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Presenter { | |
func viewLoaded() | |
} | |
class ViewPresenter: Presenter { | |
let useCase: UseCase | |
let connector: ModuleConnector | |
weak var view: View? | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol View: class { | |
func show(data: String) | |
} | |
class ViewController: UIViewController, View { | |
let presenter: Presenter | |
var label: UILabel! | |
init(presenter: Presenter) { |