Cannot Access Podcast Category from RSS Feed Using FeedKit due to Missing Member

123 Views Asked by At

I’m using FeedKit to parse podcast RSS feeds in a Swift project. Everything was going smoothly until I hit a snag trying to extract the podcast category name. Despite what seemed like a straightforward task given the URL structure of the feed (https://feed.theskepticsguide.org/feed/rss.aspx?feed=sgu), I'm stuck on this particular field.

I initially tried accessing the category with the following line, expecting to either retrieve the category name or fall back to a default value of "General":

let podcastCategory = rssFeed.iTunes?.iTunesCategories?.first?.text ?? "General"

To my surprise, this resulted in an error indicating that the ITunesCategory type doesn’t have a member named text:

"Value of type 'ITunesCategory' has no member 'text'"

Not one to give up easily, I tried an alternative, thinking maybe I mixed up the property name:

let podcastCategory = rssFeed.iTunes?.iTunesCategories?.first?.value ?? "General"

However, this also led to a similar dead end. At this point, I expected FeedKit to provide a way to access the category name seamlessly, but it seems I’m missing something or perhaps misunderstanding how FeedKit models the iTunes category data.

0

There are 0 best solutions below