-
Notifications
You must be signed in to change notification settings - Fork 38
Fix swift 3 named colors issue on Xcode 8 #76
Conversation
…or versions higher than those that xcode supports
Might be worth making the typealias name customisable via a
wdyt? |
ddc5d2d
to
01698b6
Compare
01698b6
to
29183b4
Compare
@@ -1,14 +1,16 @@ | |||
// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen | |||
|
|||
{% if catalogs %} | |||
{% set colorAlias %}{{param.colorAliasName|default:"AssetColorTypeAlias"}}{% endset %} | |||
{% set imageAlias %}{{param.imageAliasName|default:"Image"}}{% endset %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Such a shame that these two aliases don't end up to be similar (but I know, would be breaking because typealias Image
was already existing before :-/ )
typealias Image = NSImage | ||
#elseif os(iOS) || os(tvOS) || os(watchOS) | ||
import UIKit.UIImage | ||
typealias Color = UIColor | ||
typealias AssetColorTypeAlias = UIColor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the occasion of this test case to also customise the color & image typealias names in addition to the enumName being customised to XCTColorAsset
(same for all *-customname.swift
test & expected of course). This way we're sure we didn't forget to replace some hardcoded Color
identifier with {{colorAlias}}
at some point.
71110dd
to
0e90e86
Compare
Fixes SwiftGen/SwiftGen#327.
Fixes SwiftGen/SwiftGen#328.