Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/21708b354885b84ead857cd1e69aa789 to your computer and use it in GitHub Desktop.
Save laevandus/21708b354885b84ead857cd1e69aa789 to your computer and use it in GitHub Desktop.
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