URL.host(percentEncoded:) triggers EXC_BREAKPOINT crash

This reproduces the issue (both iOS 16.1 and 16.2):

if let url = URL(string: "https://") {
    let example = url.host() // triggers EXC_BREAKPOINT crash
    ...
}

The older property URL.host returns nil as expected, but is deprecated.

Post not yet marked as solved Up vote post of wildpeaks Down vote post of wildpeaks
935 views

Replies

This is a known bug (r. 103345338). For the moment you can work around it by fetching the old host property.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Does anyone know if this problem has already been corrected? I have users who have this problem on ios 16.3.1

  • I can't seem to reproduce it on iOS 17.0.1 anymore.

Add a Comment