一个简单的RSS & Atom源解析器,基于Ono构建。
需要Xcode 6。
解析源很简单。你不需要事先知道你要解析的是RSS还是Atom源,Dalton抽象掉了这些差异。
NSError *error = nil;
NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"sample" withExtension:@"xml"];
NSData *feedData = [NSData dataWithContentsOfURL:fileURL];
id<DLTFeed> feed = [DLTFeed feedWithData:feedData error:&error];
NSLog(@"Feed title is %@", feed.title);
NSLog(@"Feed was last updated at %@", feed.updated);
for (id<DLTFeedEntry> entry in feed.entries) {
NSLog(@"Entry title is %@ link is %@", entry.title, entry.link);
}
MIT。请参阅LICENSE文件以获取更多详细信息。