Twitter search within an iOS app - ios

After learning how to use Twitter within an iPhone app (with TWTweetComposeViewController), I would like to go one step further.
When the "Tweet Search button" (in my app) is tapped, I would like a view showing up with the result of a given search (for example "water falls") within Twitter.
Is this possible? And if Yes, how?
Since it is possible to fire up Twitter (within an iOS app) and the search is also possible for someone using Twitter manually, I would think the answer to my first question is Yes.
But at this point I have no idea concerning the answer to the second question.
Thanks for any relevant piece of information.

TWTweet class has a property called completionHandler which returns if successful/fail.
i would use a uiWebview object that will display the main twitter site with a query that will search for example water falls.

See this
iPhone SDK: First Steps With JSON Data Using the Twitter API
http://mobile.tutsplus.com/tutorials/iphone/iphone-json-twitter-api/

Related

How do I access safari reading list with swift

I want to make a simple app that will show a random article from a user's safari reading list, but couldn't find an easy way to do that, is it possible? Thank you in advance.
There is no way to do this. (As per iOS 10).
You can only add URL to safari using SSReadingList object using SafariServices but won't be able to read from it as that might comprise user privacy

Is it possible to get turn by turn directions using Google Maps Api in iOS?

I am looking for a way to get or make turn by turn navigation using Google Maps Api in swift. I've done drawing polylines from source to destination using GoogleMaps Api but still couldn't find a way to do turn by turn navigation. Is it possible?
-Thanks
Yes. It is possible.
Please refer following link which is using turn by turn directions using google API.
https://itunes.apple.com/us/app/biznavi-gets-you-where-you/id597147565?mt=8
(see last two screen shot of iPad from itunes link)
To achieve it, you have to use Google Direction API which allows us to use upto 8 way points.
After that you will get an array of route including all turn by turn message and lat/long.
Just create a CLRegion of 100 meters (or as per your requirement.) around your current location in locationDidUpdate method. If next point of route array falls within CLRegion, just show a message received in routes array by google API.
I have made above application but it was not updated after uploading to store so it is having old UI and it is not having iPhone 5+ support. Sorry for that but you will find feature you require in this app...

Swift: How to post to Twitter from iOS app with certain hashtag?

I'm fairly new to posting to social media via Swift in an iOS app but need to be able to post an image to Twitter under a certain hashtag (i.e the user's image is always posted under this certain hashtag regardless).
So far, my app can take a picture and access the user's photo library, but I have run into some trouble implementing post to Twitter.
I have looked at the following questions: Post on twitter from ios app
How to make an ios app post to twitter
But most of the links referenced are either gone or outdated. I have also looked into Sharekit (http://getsharekit.com) as this would do the posting to Twitter automatically it seems, however Sharekit is deprecated.
Ideally, I would like the user to be able to take their photo (I have this) give it a caption, etc WITHIN THE APP then when they press a button it more or less "silently" posts to Twitter WITH the hashtag that I will have set in the app. I am unsure as to how to accomplish this.
What is the best way/approach to posting an image to Twitter via Swift? The hashtag bit seems to be the more difficult step - how can I "force" a hashtag on the user's post?
What you're probably looking for is the Social framework and SLComposeViewController.
Using the setInitialText(_:) method you can add text to the tweet, though this doesn't really force anything, as the user still has the possibility to edit the tweet before publishing, and it doesn't really work "silently" either.
Posting an image is done with the addImage(_:) method.

Launching the standard Contacts View from my app

What I am trying to accomplish with my app is if a user clicks on a contact name in my app. I want to directly launch the selected contact in a new view, but using the standard ios contact view. Is this possible? If so how can it be accomplished? I can't seem to find any URL Scheme for the contacts app if one does indeed exist that is.
Look at the Address Book UI framework documentation, please.
By the way, using this framework is a very good idea i.e. "the standard iOS contact view", because trying to reproduce this view and all its functionality yourself would be, shall we say, challenging.

iOS TWTweetComposeViewController - Posting in background

I'm trying to integrate twitter in iOS5 app.
Using Twitter framework in my app, can I post the message in the background?
I know that using TWTweetComposeViewController, it will show a view and then it will post.
Is this possible?
The answer is no. The whole point of having the View Controller is to allow the User to see and dictate what exactly will be posted without interference from the App apart from the initial text which the user also has the option to change. It stops apps abusing the Twitter accounts from posting spam etc.
The Apple Documentation clearly states:
Although you may perform Twitter requests on behalf of the user, you cannot append text, images, or URLs to tweets without the user’s knowledge. Hence, you can set the initial text and other content before presenting the tweet to the user but cannot change the tweet after the user views it.
You can't do this using TWTweetComposeViewController. You can do this using TWRequest provided the user authorizes your app to access their Twitter account(s).

Resources