init(bytesNoCopy was deprecated in macOS 13

The reason people keep suggesting using init(decoding:as:) rather than others is because init(bytes:…) and init(data:…) are from Foundation and may produce bridged Strings, where init(decoding:as:) is from Swift itself and always produces a native String.

5 Likes