Swift fatalError is a fatal error

from blog The Desolation of Blog, | ↗ original
You may have seen the Swift function fatalError() used in code samples, but in my opinion the function ought to be avoided entirely, especially in production code, because using the function exposes TMI in release builds. When fatalError() is called in a source file, the compiler writes the full system path of the source file into the compiled binary, for both debug and release builds, because the function is designed to print the source file path along with its log message. Anyone can see the file path by running strings or otool -tV on the binary from the command line. The output will be something like this: