nmdias / FeedKit

An RSS, Atom and JSON Feed parser written in Swift
MIT License
1.19k stars 174 forks source link

Removes XMLParser subclass #20

Closed andrewconlan closed 7 years ago

andrewconlan commented 7 years ago

Some info from the developer forum

if you’re using XMLParser, you almost never subclass XMLParser because it was designed with delegation in mind

This pull request removes the XMLParser subclass and that seems to fix #4 the offline/incorrect URL crash, will probably need a bit more work in terms of access control, not my strongest suit :)

nmdias commented 7 years ago

The Parser class might seem redundant, but the reason behind it's existence is to prevent the leaking of an NSObject inheritance to the publicly exposed FeedParser. NSObject exposes 50 or so methods and properties with, as of yet, no usefulness to the user using FeedKit.

nmdias commented 7 years ago

Also, considering Apple won't resolve #4 any time soon, and the documentation suggests that the rules of Object Oriented Programming don't fit well with XMLParser, removing inheritance of an XMLParser in the Parser class would indeed fix issue #4.

andrewconlan commented 7 years ago

Hmmm I see, I hadn't though about the NSObject issue, makes sense. Who knows, beta 1 next week might have it fixed :P