To demonstrate how to use the bridge pattern, we will create two features. The first feature is a message feature that will store and prepare a message that will be sent out. The second feature is the sender feature that will send the message through a specific channel such as email or SMS messaging.
Let's start off by creating two protocols named Message and Sender. The Message protocol will define the requirements for types that are used to create messages. The Sender protocol will be used to define the requirements for types that are used to send the messages through the specific channels. The following code shows how we would define these two protocols:
protocol Message { var messageString: String {get ...