Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import UIKit
protocol InteriorLighting {
var interiorLightColor: UIColor { get }
}
extension InteriorLighting {
var interiorLightColor: UIColor {
return .white
}
}
struct Car: InteriorLighting {}
struct Truck: InteriorLighting {}
print(Car().interiorLightColor) // UIExtendedGrayColorSpace 1 1
print(Truck().interiorLightColor) // UIExtendedGrayColorSpace 1 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment