I am a beginner in swift developpment.
I am looking for help to write the swift code that would give a call to a friend of my contact list, and:
- if he answers to my call, it opens a chat window. (no vocal conversation, just chat). At the end of the call, it goes back to the app and the whole conversation is deleted definitly.
- if he doesn't answer, it gives me the possibility to let an alert and when he connects himself to the app, he has a notification that ask him if he wants to call me back.
Here are a few lines, but can't figure out how to go on :
var phoneNumber: String = "telprompt://".stringByAppendingString(titleLabel.text!) // titleLabel.text has the phone number.
UIApplication.sharedApplication().openURL(NSURL(string:phoneNumber)!)