Reuse code with protocols in Swift
medium.com