You need to include #include <SwiftUI/SwiftUI.h> for the layer definition.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: