Undefined Behavior Sanitizer is turned off initially. You must enable it in your scheme. Select the Run step in the scheme and click the Diagnostics button at the top of the scheme editor. Select the Undefined Behavior Sanitizer checkbox.

After selecting the Undefined Behavior Sanitizer checkbox, build and run your project to run it through Undefined Behavior Sanitizer. You can learn more about Undefined Behavior Sanitizer in the following WWDC video: