How to parse RSS feed details view without UIWebView? - ios

I'm designing an RSS feeder using **XCode** and **Objective-C**. However I'm a little confused on how to create the article view page without UIWebView in a manner similar to how Apple's News app does it.
Does anyone have any ideas on how to go about this?

Actually its pretty straight forward. u just need to use textlabels and UIImage / TextViews.
Just parse the feeds and display the appropriate contents in their respective fiels
i.e images in imagview and title in TextLabels.
If u want the UI to look good u can add appropriate graphics.

Related

Return a list of a YouTube Channel's videos in a UITableView

I am building an iOS app that allows a user to view all the videos in a YouTube Channel, see the thumbnail, viewpoint, and duration of the video and click to play them. I am using a custom UITableViewCell and it is working great but right now they are static cells. I would like to use the YouTube API to fill in the data for this. However, I cannot find a good example of how to do this. The basics are going to be accessing the YouTube API, getting the JSON and changing it into the TableViewCell however I cannot find any objective C examples for how I would go about this. Does anyone know how to do this? Thank you!
Check out some of the ray wenderlich tutorials like http://www.raywenderlich.com/5492/working-with-json-in-ios-5 It's a little older but the json code is good. Once you have the json data you load it into your data object, for example an array, and call reloadData on the tableview object and it will display it.
Good basic example right here - https://github.com/drice0331/YoutubeV3apiList

IOS: JSON parsing with lazy load images

So I've made an android application which parses JSON and uses the lazy load technique to load the images. (I'm creating it for a video website and need to show the thumbnail for the video ned to the title). Now I'm making it for iOS. I have made it so it shows the title and subtitle and a show a "watch" button with my custom table view cell. Is there any tutorials or articles I could look at to show me how to load the images into an image view?
Note: I have searched the web for this but could not find a good article or tutorial for it.
Many Thanks - Charlton Santana
Great solution for you is SDWebImage
check the below link, it is easy to use.
https://github.com/rs/SDWebImage
AFNetworking has JSON parsing
https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking#download-and-parse-json
and image loading
https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking#download-and-display-images

Is it possible to take an image from a UIWebView and display it natively without reloading?

Say I load a webpage with an image on it. Is there a way to reuse this loaded image within a UIImageView without reloading the image from a url?
If the image is cached by URL loading system, it will come from the cache when you try to load it.
Sorry I can't give a large explanation as im on y phone but I feel like what your looking for is 'core data store' there are several examples of how to use this framework, but it's quite complicated and has a large learning curve with ios development.
Also you say 'a' uiwebview. Does that mean that the URL your accessing to show within your uiwebview is static? If so, just copy and save the image and store the image in your project for future reference.
Or are you allowing the user to keep swapping through links in the uiwebview and store all those images that popup on the web page?
Sorry I'm just unclear with the question... Please no down votes :)

iOS iTunes Album Cover type (or similar) Image Display

Is there any tutorials that show how to make a Image display similar to the Album Art diaply in iTunes? Or anything similar. I followed code posted here, but I just cannot seem to get it working in the new XCode. Opening his project works fine, but using it in my own, the UIImageView renders the images beyond it's borders, making them appear over each other.
Any help would be appreciated.
I assume you're talking about CoverFlow?
I wrote a free, very easy to use CoverFlow library. It's modelled on the way that UITableView works, so if you can use that, you can use this. You can get it from here:
https://github.com/nicklockwood/iCarousel

iPhone OS 3.2; PDF rendering; User Interaction

I'd need to create a iPad-app which would be rendering multiple PDF-Files (one file contains one page).
Each page should be scrollable, zoomable and if the user taps on a part of the PDF a website or photo gallery should popup.
Currently i think i could do that either with:
A. UIWebView
Displays the pdf's nicely, scrolling and zooming works. But it looks like a lot of trouble to realize the clickable parts of the PDF.
I don't know if i could use CGPDFContextSetURLForRect
Getting the touch-events from UIWebView to do something like CGPDFContextSetURLForRect my self looks like it would be some "quite bad" hack. See: http://github.com/psychs/iphone-samples/blob/master/WebViewTappingHack/Classes/PSWebView.m
B. Quartz
I found some resources describing how to display PDF's directly via Quartz.
See:http://developer.apple.com/iphone/library/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_pdf/dq_pdf.html
This would allow using CGPDFContextSetURLForRect
But i have no idea if this would - like UIWebView - support scrolling and zooming out of the box?
Anybody could enlighten me on this please?
Thanks for your time!
[Edit: changed 3.0 to 3.2]
[Edit: my "solution"]
Hi!
I could come up with a working implementation for PNG but not for PDF's.
[Abstract]
My sollution was Rendering the content, intercepting the touches on it, retreiving the coordinates relative to the displayed content if it is one touch and finally looking up what to do from a mapping containing the interactive areas as coordinates and what to do if they get clicked.
[For PNG]
It was way more cumbersome to implement somethink like that than i would have imagined...
And the implementation i got working depends heavily on the content you want to display because this does work for UIImageView but i could not get it working with UIWebView.
First you need a UIScrollView and UIImageView to render the content and support scrolling/zooming.
Then you need to implement some handling to get the touches/gestures you are interested in.
See: developer.apple.com/iphone/library/samplecode/ScrollViewSuite/Listings/1_TapToZoom_Classes_TapDetectingImageView_h.html
This sample from apple provides everything you need to get this part working.
As a bonus it also takes care about transforming the coordinates relative to the viewport of the content which is very handy! (else you would only know where the tap happend on the screen wich only one half of the info you need if your content is zoom-/scrollable)
[For PDF]
If you want to do this with PDF the first thing would be that you need to use a UIWebView (probably you could do it via Quartz or something else too)
Getting the touches with a UIWebView is a real pain!
There are a lot of ways proposed on the web and besides one noone did what it should do.
After days of googling i found this gem: cocoawithlove.com/2009/05/intercepting-status-bar-touches-on.html
So... subclassing UIWebView does not get you anywhere unlike UIImageView and you have to subclass UIApplicationMain and implement its method for handling touch-events.
Here you could reuse some of the "Touch-Handling-Stuff" from the apple-examlpe from above.
Now you would need to translate the coordinates of the touch to your content if it is zoom-/scrollable. UIWebView DOES NOT do this for you unlike UIImageView!
I could never figure out how to get the required information(what part of the content at which zoomlevel) from a UIWebView to translate the coordinates but due to the changed requirements from PDF to PNG i didn't care to get it working too much.
hope this helps.
Using the CGPDF* operators will allow you to write a UIPDFView, which operates exactly as UIImageView but uses a PDF as the source image. Create your own custom subclass of UIView and implement drawRect: to, eventually, call CGContextDrawPDFPage. Based on a quick Google search (because I know the keywords), this page seems to explain that side of things quite well.
You can then directly substitute your custom UIView subclass for the UIImageView and proceed exactly as you have with the PNG solution.

Resources