2

Foundation's URL(string:) initializer can fail if the string doesn't represent a URL as defined in RFC 1808.

The URLComponents(string:) initializer can fail if the string doesn't represent a URL as defined in RFC 3986.

What is an example of a string for which URL(string:) returns a URL, but for which URLComponents(string:) returns nil? (Is there a URL string that is valid according to RFC 1808 but invalid according to RFC 3986?)

user975323
  • 23
  • 2

0 Answers0