Created
July 29, 2018 06:59
-
-
Save laevandus/21708b354885b84ead857cd1e69aa789 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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