// swiftlint:disable all // swiftformat:disable all import SwiftUI {% if argument.mainTarget %} @testable import {{ argument.mainTarget }} {% endif %} {% for import in argument.imports %} {% if import != "last" %} import {{ import }} {% endif %} {% endfor %} {% for import in argument.testableImports %} {% if import != "last" %} @testable import {{ import }} {% endif %} {% endfor %} enum TestablePreviewsDictionary { static let dictionary: [String: any PreviewProvider.Type] = { var dictionary: [String: any PreviewProvider.Type] = [ {% for type in types.types where (type.implements.TestablePreview or type.based.TestablePreview or type|annotated:"TestablePreview") and type.name != "TestablePreview" and not type.attributes.available %} "{{ type.name }}" : {{ type.name }}.self, {% endfor %} ] // Previews carrying an @available attribute (e.g. those observing state through the iOS 26 // Observations-based observe(_:)) can't be referenced unconditionally in this iOS 18 target. if #available(iOS 26.0, *) { {% for type in types.types where (type.implements.TestablePreview or type.based.TestablePreview or type|annotated:"TestablePreview") and type.name != "TestablePreview" and type.attributes.available %} dictionary["{{ type.name }}"] = {{ type.name }}.self {% endfor %} } return dictionary }() } // swiftlint:enable all // swiftformat:enable all