Sunday, October 2, 2022
HomeiOS DevelopmentEnabling Concurrency warnings in Xcode 14 – Donny Wals

Enabling Concurrency warnings in Xcode 14 – Donny Wals

If you wish to guarantee that your code adopts Swift concurrency as appropriately as doable in Swift 5.7, it is a good suggestion so as to add the -warn-concurrency compiler flag to your challenge’s construct settings.

To do that, choose your challenge’s goal and navigate to the Construct Settings tab. Be sure to choose All from the listing of settings that’s proven (Fundamental is the default) and sort Different Swift within the searchbar to search out the Different Swift Flags construct settings. Double click on on the empty house beneath your app identify and hit the + button within the popup that is introduced. Sort -warn-concurrency, and hit enter.

The screenshot under reveals all of the related components so that you can see:

You’ve got now succesfully enabled a stricter set of compiler checks on your concurrency code that can, for instance, produce warnings on your code that touches Sendable in a extra correct method. This lets you alter your code now, quite than when a few of these warnings turn into errors in Swift 6.



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments