Avatar
@nishitaku @swift-5.2.5 // Use Case class UseCase { var delegate: UseCaseDelegate? func foo() { delegate?.showX(42) } } protocol UseCaseDelegate: AnyObject { func showX(_ x: Int) } ////////////////// // Presenter class Presenter: UseCaseDelegate { func showX(_ x: Int) { print(x) } } let useCase = UseCase() useCase.delegate = Presenter() useCase.foo()