How to resolve the "Declaration name is not covered by macro" error

Oscar de la Hera Gomez
Two flowers that represents SwiftUI and XCode side by side with the text “Declaration name is not covered by macro error” beneath it.

In XCode, open your Swift Macro and in the Macro definition, set the names to "arbitrary".

A screenshot of the error that XCode produces informing you that Declaration name "sample" is not covered by macro.

To resolve the error above, open the macro and navigate to the definition.

A screenshot of XCode showing a declaration for a member macro. The names are defined using "named(init))".

Replace names: named(init) with names: arbitrary.

A screenshot of XCode showing a declaration for a member macro. The names are defined using "arbitrary".

This will resolve your issue.

A screenshot of Xcode showing how the issue has been resolved.

Looking to learn more about SwiftUI, Swift, Design and Technology?

Search our blog to learn more about Swift, SwiftUI, design and technology.

Any Questions?

We are actively looking for feedback on how to improve this resource. Please send us a note to inquiries@delasign.com with any thoughts or feedback you may have.
delasign logo

Book a Free Consultation.

An icon of an email.

Click here to email us.

Fill in the details below to book a free consultation or to let us know about something else. Whatever it is, we are here to help.

How can we help you ?

Contact Details