Comment on NSURL return nil while the URL is correct FWIW, Quinn's answer (eskimo) is more performant. URL parsing from string is notably expensive. For posterity, just wanted to comment that folks should use composition to build their URLs and not parsing whenever possible. Programming Languages Swift Dec ’23