This SJLatexView renders the math equation like a charm, here is how it works:
You just initilize it like any other UIView, once you have your latex string you want to display, just call the loadLatexString
method on the view and it will display accordingly.
let latexString = "When $a \\ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are$$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.$$"
latexView.loadLatexString(latexString)
It will appear something like this:
Notice that if you use string literals directly, you will have to escape the "" character within the literal
It is a bit hacky, SJLatexView is a subclass of UIWebView which uses mathjax to render the math equations in javascript.
I will try to add in more functionality like the ability to specify font and padding etc. I will also try to download the mathjax file in advance to prevent repetitive fetching.