stringByReplacingOccurencesOfString() for Swift 3.0

You can fix your snippet using …

clockworkSmsUrl.replacingOccurrences(of: " ", with: "+")

Swift 3 changed the way how objc APIs are imported.

Please note that there are some issues with the code you posted:

  • the result of replacingOccurrences is discarded.
  • there are more characters to be escaped.
  • URLCompontents exposes safer ways to construct URLs.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)