3 ms·
In the article, he mentions the need for a DOM parser dependency for his app, as Swift “does not have one.” > AEXML was needed to parse some XHTML files as the
by ChrisMarshallNY 5y ago
In the article, he mentions the need for a DOM parser dependency for his app, as Swift “does not have one.”
> AEXML was needed to parse some XHTML files as the native iOS SDK does not provide a DOM parser.
I have used Foundation XML parsers[0] for many years, but they are general-purpose; not specifically modeled on DOM or HTML, which probably limits usefulness on some Web content.
That said, if he has control of the content (don’t know the app, so I am not sure), then there should be no reason that they couldn’t render it in XHTML, so the Foundation parser could be used reliably. In the article, he mentions that the content is XHTML. I have to assume that AEXML[1] is easier to use than the built-in parser. It uses Foundation parsing (it actually seems to be a lightweight wrapper for the built-in parser), under the hood (and seems to be a very well-written dependency).
So, it could be posited that he would only need one dependency for his native version, if he wanted to handle the XHTML parsing, himself.
Personally, I am a huge believer in native platform development, having many, many scars from the compromises required for cross-platform solutions.
That said, I totally understand why folks prefer cross-platform development, and can’t, in good conscience, recommend a native approach for all apps.
[0] https://developer.apple.com/documentation/foundation/archives_and_serialization/xml_processing_and_modeling https://developer.apple.com/documentation/foundation/archive...
[1] https://github.com/tadija/AEXML https://github.com/tadija/AEXML