How to create dynamic user interface using xml in ios?

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.

xml data sample:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

Your XML data sample didn’t make it through.

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.

Hello Rcasey,

Thank you very much for your reply,

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.

my sample xmlfile:

<?xml version="1.0" encoding="UTF-8"?>

Expected output:

xml format:
<?xml version="1.0" encoding="UTF-8"?>
<root>
    <view id="1" color="0.8 0.7 0.9 1.0" x="0" y="0" width="320" height="480">
        <view id="2" color="0.9 0.1 0.3 1.0" x="20" y="20" width="280" height="200">
            <textfield id="5" x="10" y="90" width="180" height="40" placeholder="enter text" color="1.0 1.0 1.0 1.0" target_id="6" />
            <button id="4" color="0.2 0.2 0.2 1.0" x="220" y="90" width="40" height="40" title="push" />
        </view>
        <view id="3" color="0.1 0.8 0.3 1.0" x="20" y="240" width="280" height="100">
            <label id="6" color="0.5 0.5 0.5 1.0" x="20" y="20" title="some label..." width="200" height="80" />
        </view>
    </view>
</root>

Hello Raja_Karumanchi.

hope you are doing well.
I need to ask question is that did you able to create ui from XML?

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.