-
Notifications
You must be signed in to change notification settings - Fork 561
Use a code-first approach to app-level debugging options #15428
Copy link
Copy link
Open
Labels
breaking-changeIf an issue or a pull request represents a breaking changeIf an issue or a pull request represents a breaking changeenhancementThe issue or pull request is an enhancementThe issue or pull request is an enhancement
Milestone
Description
The CheckForIllegalCrossThreadCalls and CheckForEventAndDelegateMismatches fields are hard to discover and tweak (the developer has to modify build settings to get them linked away (or not, depending on the configuration)).
The proposal is to:
- Change these static fields to be static properties instead. This will:
- Avoid the need for any logic in the static constructor (to set these values to true).
- Make it easier for the trimmer to trim them away.
- Update templates to set these values to
truefor debug builds:
#if DEBUG
// Enable runtime checks to ensure some types are only used from the main (UI) thread
UIApplication.CheckForIllegalCrossThreadCalls = true;
// Enable runtime checks to ensure ObjC delegates and events (using their own delegates) are not mixed
UIApplication.CheckForEventAndDelegateMismatches = true;
#endifRef: #13747
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking-changeIf an issue or a pull request represents a breaking changeIf an issue or a pull request represents a breaking changeenhancementThe issue or pull request is an enhancementThe issue or pull request is an enhancement