TipViewStyle not compiling

I'm creating a simple TipViewStyle based on sample code but it fails to compile. It displays: Type 'MyViewStyle' does not conform to protocol 'TipViewStyle'

When I choose the Fix option, it adds this line:

`type alias Body = type'

What should the type be here?

struct MyTipViewStyle: TipViewStyle {

    func makeBody(config: Configuration) -> some View {
        VStack {
            config.title
            config.message?
        }
}
Answered by Frameworks Engineer in 814536022

That might be referencing an older API. Try changing the parameter name to configuration:

struct MyTipViewStyle: TipViewStyle {
    func makeBody(configuration: Configuration) -> some View {
        VStack {
            config.title
            config.message?
        }
}
Accepted Answer

That might be referencing an older API. Try changing the parameter name to configuration:

struct MyTipViewStyle: TipViewStyle {
    func makeBody(configuration: Configuration) -> some View {
        VStack {
            config.title
            config.message?
        }
}

Oh, I should have caught that. Thanks!

TipViewStyle not compiling
 
 
Q