Skip to content
 

RSSReader Version 2.0 with UITabBarController

Couple of months back I released an open source RSS Reader app for iPhone on GitHub. Most of the people who downloaded the source requested for an updated version using UITabBarController.

Today I am releasing version 2.0 with the following changes

  • Updated the views to use UITabBarController
  • Loads rss subscription from plist file
  • More fun to learn ;-)

Download RSSReader Version 2.0 with complete source for iPhone. To see complete list of changes visit RSSReader on Github

Note: This source code does not have any license nor warranty. Please feel free to use this in any of your projects and don’t have to email me.

Enjoy, Happy Coding ;-)

  • helpmeoutimlegitandlearning

    Hey, Thanks for this! Great work! I was wondering, how would you modify your code to show a one RSS feed, a “main rss feed” in the first tabBarController in a tableViewController with the navigationViewController detail pages in XCode4? Appreciate your sharing!

    • http://imthi.com Imthiaz

      Hey that is a simple. Please change the way it is being called

      • helpmeoutimlegitandlearning

        Hi Thanks for the reply. I appreciate it. Would you mind explaining this a bit further? I got confused with how things would change since you are using the plist file to call all the tab bars and contents. I’m new to this stuff and trying to figure things out for myself. You probably won’t care to give instructions on it, but if you could it would help a lot. Thanks again.

        • http://imthi.com Imthiaz

          Hey, This is a small code which you edit in RSSReaderAppDelegate.m Please find the first line in this code and append in your project.

          #import "NewsListViewController.h"
          #import "RSSListViewController.h"
          
          UINavigationController * newsNavigationController = nil;
          
          //Create the view you want to push to the tab bar
          RSSListViewController * rssListViewController = [[RSSListViewController alloc] initWithRSSURL:@"http://burner.imthi.com/imthi";
          
          //Create a new instance of navigationbar for that tab
          newsNavigationController = [[UINavigationController alloc] initWithRootViewController:rssListViewController];
          [newsNavigationController setTitle:@"Imthiaz Blog"];
          [newsNavigationController.tabBarItem setImage:[UIImage imageNamed:@"glyphicons_291_snowman.png"]];
          
          //Add that tab to the list of view controllers we are going to set for the tab bar.
          [viewControllers addObject:newsNavigationController];
          [newsNavigationController release];
          [rssListViewController release];
          

          I would suggest you read more about view controllers

          http://bit.ly/qwkVcL
          http://bit.ly/oiq3ck
          http://bit.ly/nc0S28

          Don’t worry this will take a little time to get it right. Once you crack it you will get around it faster ;-) Hope this helps.

      • Keshav

        hi, Imthiaz….!!!!
        i have seen the code for RssReader,
        is there any tutorial for explaining this code ,, please suggest me ,
        where to start , where to end???? i mean to ask you that , the flow…….

        thanks and regards from Keshav in advance….

      • Ravi

        Hi Imthiaz can u send the detail steps of rss feeds source code to my mail id
        (rakipasumarthi@gmail.com)

  • helpmeoutimlegitandlearning

    Also, it’d be really cool if you could show how to take the rss feed content, parse it, and display the content formatted onto a UIView. That’d be really great, instead of showing a UIWebView to an external website.

    Thanks again!

    • http://imthi.com Imthiaz

      Most of the RSS content is in HTML so I prefer using UIWebview. You can customize with your own CSS and HTML.

      • helpmeoutimlegitandlearning

        Thanks for the useful information! I hope to see more code (and maybe some tutorials?) in the future. I’ve subscribed to your blog!

  • http://- luke

    hey..

    first: thank you for this, it is really great !

    well, im wondering how i can change the colour of the standart blue navigation at the top ?
    i spent hours.. but i dont get that to work.. :-( im new to this, and i need some help.. i think it would be a very easy one for you.. :-)

    thanks a lot for your help – and sorry for my english, im not a a native speaker (as you might guess) ;-)

    • http://imthi.com Imthiaz

      HI Luke

      I am glad this code helped you. To change the color of the navigation bar is quite simple.

      In the file RSSReaderAppDelegate.m add this line

      [newsNavigationController.tabBarItem setImage:folderIconImage];
      [newsNavigationController.navigationBar setTintColor:[UIColor blackColor]];

      You can set any tint color you want.

      Hope this helps

      Cheers
      Imthi

  • http://- luke

    hey imthi

    THANK YOU !! works perfect..!:)

  • Josh

    Would it be complicated to go from one of the icons on the tab bar directly to a UIwebview the way you have this built?

  • stefan

    Hi imthi,
    I’m trying to change the language of the “… more” button, but failed – I’ve spent some hours on finding a tutorial on this topic. Do you know, how to manage it?
    Thank you in advance for your help!
    Cheers,
    Stefan

  • mary

    Hi there!
    Thanks for your great work!
    Do you know how to integrate a logo into the navigation bar?

  • luis

    I’m looking very good tutorial as I can make the application to see entering the website of the original news bbc look either like my application to not see the BBC news?

    another question to be a rss required data base data base used for this example?

  • luis

    example view app pulse not seen the original news where it is seen as the application

  • John Yeong

    Hi Imthi,
    Would u please tell me how you access the back button for the list view and browser view controllers? I have been spending lots of time trying to access the buttons to change it’s name to a standardized @”back” word. But all in all, thxx imthiaz, the rss reader worked great for me.

    Regards,
    -John-

  • John Yeong

    Ok i found it. That makes u perfect. Thx Imthi, you Rock!!!

    Regards,
    -John-

  • John Yeong

    Ok it doesnt work. Sorry Imthi, could i please relive my first message again? I actually changed the foldertitle in the appDelegate.m. It works, but the header title also changed. Sorry.

    Regards n apologies,
    -John-

  • sajid

    sir can u pls post pdf viewer including bookmarks, search text, outline… also answer to me if we can use tab bar for pdf reader…. in iphone..

  • http://sajid.beria@ilimitech.in sajid

    sir i have seen fastpdfkit but its very confusing, whats the simple way for the same..

  • http://joshuamauldin.com JM

    Hello! I can’t seem to get your code to work.


    //
    // RSSReaderAppDelegate.m
    // RSSReader
    //
    // Created by Imthiaz Rafiq @hmimthiaz
    // http://imthi.com
    // https://github.com/hmimthiaz/RSSReader
    //

    #import "RSSReaderAppDelegate.h"
    #import "RSSParser.h"
    #import "NewsListViewController.h"
    #import "RSSListViewController.h"

    @implementation RSSReaderAppDelegate

    @synthesize window=_window;

    @synthesize tabBarController = _tabBarController;

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{

    self.tabBarController = [[[UITabBarController alloc] init] autorelease];
    NSMutableArray * viewControllers = [[NSMutableArray alloc] init];

    //plist file full path
    NSString * subscriptionListFile = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"RSS_Subscription.plist"];
    //Load plist file as dictionary
    NSDictionary * subscriptionList = [[NSDictionary alloc] initWithContentsOfFile:subscriptionListFile];
    //Get the folder array
    NSArray * subscriptionFolders = [subscriptionList objectForKey:@"Folders"];

    NewsListViewController * newsController = nil;
    UINavigationController * newsNavigationController = nil;

    //Create the view you want to push to the tab bar
    RSSListViewController * rssListViewController = [[RSSListViewController alloc] initWithRSSURL:@"http://burner.imthi.com/imthi";

    //Create a new instance of navigationbar for that tab
    newsNavigationController = [[UINavigationController alloc] initWithRootViewController:rssListViewController];
    [newsNavigationController setTitle:@"Imthiaz Blog"];
    [newsNavigationController.tabBarItem setImage:[UIImage imageNamed:@"glyphicons_291_snowman.png"]];

    //Add that tab to the list of view controllers we are going to set for the tab bar.
    [viewControllers addObject:newsNavigationController];
    [newsNavigationController release];
    [rssListViewController release];

    for (NSDictionary * folderDetails in subscriptionFolders) {

    NSArray * newsItems = [folderDetails objectForKey:@"Items"];
    NSString * folderTitle = [folderDetails objectForKey:@"FolderName"];
    NSString * folderIcon = [folderDetails objectForKey:@"FolderIcon"];
    UIImage * folderIconImage = [UIImage imageNamed:folderIcon];

    newsController = [[NewsListViewController alloc] initWithNewsSourceList:newsItems];
    [newsController setTitle:folderTitle];

    newsNavigationController = [[UINavigationController alloc] initWithRootViewController:newsController];
    [newsNavigationController setTitle:folderTitle];
    [newsNavigationController.tabBarItem setImage:folderIconImage];

    [viewControllers addObject:newsNavigationController];
    [newsNavigationController release];
    [newsController release];
    }
    [self.tabBarController setViewControllers:viewControllers];
    [self.window addSubview:self.tabBarController.view];

    [self.window makeKeyAndVisible];
    return YES;
    }

    - (void)dealloc{

    self.tabBarController = nil;

    [_window release];
    [super dealloc];
    }

    @end

    I keep getting syntax errors about how closing brackets and semicolons are expected. Any idea?

  • jtyl2000

    Hi Imthi,
    I was wondering how do you actually create sub-folders? I want some of my rss views to separate sub folders withiin the main folder as well.