Latest 0.2.1
License MIT
Platforms osx 10.8, requires ARC

Version Status Platform Carthage compatible MIT License

An RSS feed generator and parser for macOS. Swift and Objective-C compatible.


Install using CocoaPods by adding this line to your Podfile:


target 'MyApp' do
  pod 'CSFeedKit'

Creating an RSS Feed

The example below creates an RSS feed and prints the resulting XML string.

// Create a channel
let channel = CSRSSFeedChannel.init(title: "My RSS feed", link: "http://my.rss.feed/", description: "My first CSFeedKit RSS feed")
channel.category = "Examples"

// Add an item to the channel
let item = CSRSSFeedItem(title: "Item" , link: "http://my.rss.feed/item", description: "The coolest item so far.");
item1.creator = NSFullUserName()

// Create the feed
let feed = CSRSSFeed()

// Add the channel to the feed

// Output the XML
print ( feed.XMLDocument().XMLStringWithOptions(NSXMLNodePrettyPrint))

Parsing an RSS feed

The following prints out the titles and URLs of the items in the Hacker News RSS feed.

do {
    // Get the XML string (don't do it like this in the real-world ;) )
    let xmlString = try NSString.init(contentsOfURL: NSURL(string: "")!, encoding: NSUTF8StringEncoding)

    // Init the feed
    let feed = try CSRSSFeed.init(XMLString: xmlString as String)

    // Print channel info
    let channel = feed.channels.firstObject as! CSRSSFeedChannel
    print("channel: (channel.title)")

    // Print the items
    for (_, item) in channel.items.enumerate() {
        var rssItem = item as! CSRSSFeedItem
        print(" * (rssItem.pubDate) - (rssItem.title) ((")
} catch {

What’s Next

Run the built-in example:

Check out the complete documentation on CocoaDocs.

Latest podspec

    "name": "CSFeedKit",
    "version": "0.2.1",
    "license": "MIT",
    "summary": "An RSS feed generator and parser for macOS. Swift and Objective-C compatible.",
    "homepage": "",
    "authors": {
        "Cu0103tu0103lin Stan": "[email protected]"
    "social_media_url": "",
    "source": {
        "git": "",
        "tag": "0.2.1"
    "module_name": "CSFeedKit",
    "source_files": [
    "public_header_files": [
    "platforms": {
        "osx": "10.8"
    "osx": {
        "frameworks": "Foundation"
    "requires_arc": true

Pin It on Pinterest

Share This