internal extension Color {
// Assets.xcassets
static var midnightBlue : Color { Color("midnightBlue", bundle: BundleToken.bundle) }
}
internal extension Image {
// Assets.xcassets
static var abc : Color { Image("abc", bundle: BundleToken.bundle) }
}
Color.midnightBlue // Color
Image.abc // Image
One more nice thing about extending
Color
andImage
is getting type inference in places where it's applicable. For example:Not a major thing by any means, but still :)