objective c: fit twitter page width in UIWebview - objective-c

I have a UIWebview in which a twitter page loads. Because twitter is being opened from a mobile device it opens the mobile twitter which has a specific width depending on device, and device orientation. Now my query: my UIWebview's width is shorter than mobile twitters width so the user has to scroll sideways to read content. I do not want that and want to change the zoom or preferably the width of the twitter page so it can fit in my uiwebview.The height is fine, scrolling up or down is normal. I have tried using "setScalesPageTofit" in my "webViewDidFinishLoad" and that displays the whole twitter page going out of the webview bounds. I have also tried using "sizeTofit" but no success. If any more details required please left me know
Thank you very much..

Checkout this SO Post: Getting iPhone's mobile twitter webapp inside UIWebView. The person who posted the question answered his own question.
The trick seems to be setting the correct "device-width".

Related

What grid/view does Instagram use for the feed?

I'm in the process of emulating an instagram like application for iOS using Xcode and objective-c. I looked around but I could not figure out how Instagram implemented the following grid feed:
https://debsphuong.files.wordpress.com/2014/10/5-volleyball-hashtag-page.jpg
Any insights would be greatly appreciated it. Thank you
That is a UICollection view. when you tap on the button to turn that grid into a single column grid, the cells are resized to the width of the view and reloaded again.

Is it possible to programmatically force an ios ap in split view to go full screen in ios9?

I am developing this app for ipad and ios9 and at some point the user will click on a button to watch a video. But I wouldn't want the user to just see it in the split view size he's currently on (like 1/3rd or 14th) instead I would like the app to close the other open app and for it to take over the entire screen.
Does anyone know if that's possible? Thanks.
By-default, the video always get played in full-screen mode. When video playing is finished, the player gets dismissed and you will see your screen (from where you played the video). In your case, in split view controller.
Do let me know if you need further details.

Embedding YouTube video into a wall

I have an app, that has a wall, in which there can be text and YouTube links. What I want to do is to detect if that video is from YouTube, that's not hard, but the other part is to play it inside the app, not exiting it. Which I find quite hard to do.
Should I look into UIWebView, or that would only play all the videos?
If you open a youtube link in a uiwebview, this will give you the proper experience.
To do this, create a webview and display it modally (or in a navigationController). Then send the URL request with the youtube link to the webview. You will then have to either manually or automatically dismiss the webview.
Take a look YouTube video in UIWebView and UIWebView modal YouTube player "Done" button action .

UIWebView: how to hide part of the content of a webpage?

In my app I have a webview that is used solely for displaying the facebook page.
However, the client does not want the top blue bar of facebook to appear; he wants to hide it.
Is there a way to do this?
The bar is 45 pixels, so what I did is I moved the UIWebView in IB in such a way that its top 45 pixels are behind my navigation bar (thus not appearing).
However, this is not an ideal solution, as the user can see that content when he scrolls up, before bouncing. He can see but not touch it, which will be frustrating for some users.
I tried turning the bouncing off, but then the UI becomes too rigid, and not fluid.
I looked up in Google and Stackoverflow for a couple of hours but didn`t find a solution.
Thanks a lot!
You'll have to edit the HTML/CSS of the page itself to hide the HTML elements in question, probably using regular expressions, and feed it into your UIWebView with loadHTMLString:baseURL:.
I've done similar manipulating before and it works, but... it's a different ballgame when the webpages in question don't belong to you. Any time Facebook updates their layout, your app behavior might change until you have time to get an app update approved. Clients want what they want, but make sure your client knows what he's asking for!
First test out the javascript code used to hide whatever elements in the webpage and then pass up to stringByEvaluatingJavaScriptFromString of UIWebView to run it.

Play Video on Mobile Safari for iPod touch

I have a web site that opens iframe for video on page, page uses ajax to pull in videos from selected menu. As expected and understood, on iPod touch after selecting video it shows a play button, which brings up video in another screen. However, when the video completes, it returns browser to page prior to one where video was played from. Sequence:
open Page1
go to Page2 which offers videos to play, in iframe
play video
video completes, returns to Page1, not Page2!!
Only happens on iPod touch, so must be issue with how control is returned on video completion.
Any suggestions? If this is not a known problem, I can work up example (currently, need account on site).
Of course, because the browser returns the URL of the page that was displayed before the video was played back. It won't remember the URL of the IFRAME, that had already changed in the process of selecting a video, if I don't get you wrong.
That's a common problem with frames/iframes and one reason why you shouldn't use them.
The solution could be to place your video selection menu in your actual page and not in an IFRAME. This could be achieved by loading in into a DIV via Ajax for example.
Figured this out, sort of. Got it to go back to the right place, but I do believe that it is easy to confuse the iTouch quicktime player and Safari about where to return to.