Xcode 14 beta compile error when generate xcassets
It seems that release 6.6.0 come with SwiftUI support (#979) breaks compiling on Xcode 14. Xcode 14 disallows usage of @available on stored properties:
Same error here with Xcode 14 beta 5.
The same with Xcode 14 GM
Same error. You can use custom templates(cat a swift5 templates and delete SwiftUIColor).
Steps:
-
In Bash run:
swiftgen template cat xcassets swift5 > xcassets-custom.stencil -
Remove canImport(SwiftUI) parts in xcassets-custom.stencil
-
In swiftgen.yml file make changes: xcassets: inputs: - AppName/AppSources/Assets.xcassets outputs: - templatePath: xcassets-custom.stencil output: AppName/AppGenerated/Assets.swift
PS: templateName need to templatePath in swiftgen be careful!
Another option is to downgrade to version 6.5.1 (or earlier), which is working without issues in Xcode 14 and iOS 16.
Still can't compile in Xcode 14.0.1 with SwiftGen 6.6.2
This still happens on Xcode 15.3 and SwiftGen 6.6.3 @djbe Looks like we're stuck with SwiftGen 6.5.1, which is the last working version, due to https://github.com/SwiftGen/SwiftGen/pull/979