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 String
s, where init(decoding:as:)
is from Swift itself and always produces a native String
.
5 Likes