Using HTML or any markup language for presentations in iOS

To programmatically implement interfaces on iOS is too much, in my opinion. Of course, you can do this in IB, but it seems to me that I am reusing my code and I don’t like changing one thing in 10 different places or distributing my interface in 100 IB files to avoid this. In addition, IB is very slow, although I have a new generation Macbook Pro, I still have to wait 3-4 seconds to open large files, not to mention the lack of zoom, and general clumsiness makes me run when I hear about it .

Now, the question is whether there is any open-source action or in any other way to describe the layout (not necessarily the presentation logic), just the layout in HTML or any other markup language.

So far I have seen that it CALayerhas a property stylethat can be used, however it does not support positioning. In addition, I tried to use it UIWebView, but it seems that it forced me to use my logic inside the HTML code as well, which I don’t want, plus, more slowly.

What else could I try?

+5
source share
2 answers

You could take a look at Nimbus CSS . It does exactly what you are looking for in CSS. It supports positioning and is pretty stable.

+1
source

I understand this question is a couple of years old, but if someone is looking for something like this, take a look at MarkupKit:

https://github.com/gk-brown/MarkupKit

, iOS . , :

<UILabel text="Hello, World" font="System 24" textColor="#ff0000"/>

:

UILabel *label = [UILabel new];

[label setText:@"Hello, World"];
[label setFont:[UIFont systemFontOfSize:24];
[label setTextColor:[UIColor colorWithRed:1.0 green:0.0 blue:0.0 alpha:1.0]];

CSS-, .

:

https://github.com/gk-brown/MarkupKit/blob/master/README.md

:

https://github.com/gk-brown/MarkupKit/wiki

, .

+1

All Articles