I have a requirement where in I need to generate a dynamic UI while reading xml in objective -c.
for example:
I have an xml file which contains a Label, a textfield, and a Button which needs to be converted to UI , please find the attachment for the same. I shall pass that xml file to view controller to display the UI which uses xml file directly, rather than parsing it.
i am unable to proceed on the same , could u please guide me through.
my xml data and required out put scree attached below.
You could pass the XML file to a view controller, but that view controller would need to parse the XML file in order to determine what UI elements need to be created.
I tried the approach which was sugessted by you. but I am not getting any luck.
is there any API for passing XMLdata to a view controller, for building UI elements automatically.
What would be the best way to let my app know of xml layout . I was thinking of a downloadable XML file which defines the layout but don’t really know how to implement this or if its even the best way.
In case you’re still looking for an xml parser, I used this one recently and it did the job:
It was for a very simple use case, so I haven’t fully battle tested it, but was pretty happy with it. It converts the xml to a Dictionary, which should make the data much easier to work with.