Protocol Extension, Mutating Function
I am using swift 2.0, I have a protocol and an extension on the protocol to create a default implementation of a method, the code is as fallows: protocol ColorImpressionableProtocol { var lightAccentColor: UIColor? {get set} var accentColor: UIColor? {get set} var darkAccentColor: UIColor? {get set} var specialTextColor: UIColor? {get set} mutating func adoptColorsFromImpresion(impresion: ColorImpressionableProtocol?) } extension ColorImpressionableProtocol { mutating func adoptColorsFromImpresion(impresion: ColorImpressionableProtocol?){ lightAccentColor = impresion?.lightAccentColor