Adapter Pattern in Swift for Beginners

“It is not the strongest of the species that survives, nor the most intelligent. It is the one that is most adaptable to change.”

-Charles Darwin

Image by Jono Dry on Jono Dry Art
Adapter Pattern Class Diagram

When do we use it?

US to EU outlet adapter (converter)

Implementation

ThirdPartyAuthenticator
AuthenticationServiceProtocol
ThirdPartyAuthenticatorAdapter
LoginViewController

Moment of truth, let's test it out

Example
Login successful.
Email: kimyon@catmail.com
Token: 64236324.375928.23934324

Be careful when…

Software Engineer. iOS. Java Backend.