ios - Trying to launch Twitter in Safari if app redirect fails -


I am trying to add a follow-up button inside my app so that users can follow me on Twitter for support and updates. Able to .

What I would like, if available, the Twitter app is to be launched and if not, then Safari will launch and redirect to my app's Twitter page.

At the moment my app is the code to launch your Twitter page via work, though it is not working, if the user has not installed Twitter.

Here is the tutorial which I was following:

Here is my code:

  @IBAction function followOnTwitter (this: AnyObject) {if UIApplication.sharedApplication () openURL (NSURL.URLWithString ("Twitter: // user? SCREEN_NAME = AffordIt_App")) {if UIApplication.sharedApplication (). OpenURL (NSURL.URLWithString ("https://twitter.com/AffordIt_App")} {}}}    

you are missing operator in

  if UIApplication.sharedApplication () openURL (NSURL.URLWithString ("Twitter: // user SCREEN_NAME = AffordIt_App"))   

The reason why this browser does open, so can not get the Twitter app should try.

Check again later.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -