I need to convert some HTML into plain text and have tried the approaches outlined here:
Convert HTML to Plain Text in Swift
The problem is that on iOS 8.2, NSAttributedString has a bug which can result in a EXC_BAD_ACCESS crash (deep inside WebKit) when HTML is rendered to plain text on a background thread. The conversion needs to be done on a background thread because it can (and usually does) take a while.
So I need a more primitive solution in Swift, ideally an idiomatic one.
It also strikes me that this is probably one of those problems which has an elegant and neat functional solution - it's essentially a filter()
operation on a String surely?