Create a RSS Reader in Swift

The following steps are intended to let you create your own RSS Reader using Swift.

Create a class called RssItem

The RssItem is a class and each of the Rss XML attribute is a property of the class and save it as RssItem.swift.

Create a class called RssItemManager

The RssItemManager is truly the parser. It loads the content from any remote URL (or) document & then parses it. Save this as RssItemManager.swift

Create a class called RssItemManagerDelegate

The RssItemManagerDelegate is called when the ItemManager completes parsing either successfully or encounters errors. This delegate is used by a client using these classes to inform itself. Save this as RssItemManagerDelegate.swift

Making it all work

After you have created all these Swift files in your xCode project files, you can simply make it all work by invoking the RssItemManager. Please note that the class invoking this function should subscribe to the RssItemManagerDelegate.

You can insert the following piece of code into your app logic.

You must then also insert appropriate logic into the delegate functions listed below:

Where can I find the files?

Click here to find them on github or using the following link to get to it:

Credits: Image sourced under creative commons. Click here for the original source.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.