I need to make a phone call from the app, so far it's working. The number consists of two numbers: phone number, and pass code followed by hashtag. But some users need to put double hashtag in the end of the number, and that crashes the app when it's calling that URL at once:
UIApplication.sharedApplication().openURL(NSURL (string: "tel//:1111111,,222##"))
With single hashtag it's working, and it is possible to press hashtag on the keyboard after device has dialed already. I tried to append ASCII table - hex number, 23 (means #) - it did not help.
EDIT:
I've found something here:
let encodedHost =
numberToDial.stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet())
which does swap the hashtags like this:
But when trying to call this number (NSURL) - the app still crashes. How can I still have double hashtag in the end of the URL and not crash the app?