RSS reader iOS

* * * * * (11 ratings)
RSS reader | App Code for Sale | Hero

Screenshots

Overview

RSS reader application reads RSS feed and display results in table view. Application is easy to customize and understand how it works. Use it to display RSS feed information from your website or from some other website with interesting feed content.

How To | Edit iPhone App Source Code

Application loads RSSTableViewController and displays all feed items in table view. Each row is one item from feed.

Click on row will open new view that consists of web view and it'll load from link defined in RSS.

Feed is defined in FeedDownloader.m, for sample we use Google news RSS feed.

There are 4 defines:

  • feed URL

  • feed object name

  • feed title

  • link

    // Feed defines #define feedURL @"http://news.google.com/?output=rss" #define feedObject @"item" #define feedTitle @"title" #define feedBody @"link"

Change this defines to match your RSS feed item names. Feed is parsed wirh NSXMLParser:

// NSXMLParser allocation, initialization with content of URL
xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:[NSURL URLWithString:feedURL]];

Each cell in our RSSTableViewControler shows title of feed object.

// Set cell text to feed title
cell.textLabel.text = [[feeds objectAtIndex:[indexPath row]] feedTitle];

Cell shows up to 3 lines of title text. Each cell have disclosure indicator that show user he can tap on cell to view more data. Method didSelectRowAtIndexPath will allocate new WebViewController and it'll show content of link from feed.

// Set up web view to show details
UIViewController *webViewController = [[WebViewController alloc]
initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]];
[(UIWebView*)webViewController.view setScalesPageToFit:YES];
[webViewController setTitle:[[feeds objectAtIndex:indexPath.row]
feedTitle]];

// Prepare URL
NSString *urlString = [[feeds objectAtIndex:indexPath.row] feedLink];

// URL request
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString]];

// Show web view
[self.navigationController pushViewController:webViewController animated:YES];

// Load URL request
[(UIWebView*)webViewController.view loadRequest:request];

// Release web view
[webViewController release];
4 Comments Leave a comment