Read tag from XML file and dynamically create ui in swift

<T s="" b="">
   <L l="Lable's name"/>
   <S l="Select Something">
     <O v="1"/>
     <O v="2"/>
   </S>
   <B l="Cancel"/>
   <L l="Lable's name"/>
   <S l="Select Something">
     <O v="1"/>
     <O v="2"/>
   </S>
   <B l="Submit"/>
</T>

i have the above code in xml file. I used SWXMLHash to parse. What i want to do is when parser found L tag, i want to create uilabel and uilabel’s text value will be attribute value of L tag. And when reach S tag, i want to create picker view and it’s value is inside o tag and b tag for button. is there any way to achieve it.

@kaungsoe,
TLDR; Yes

You can do this, however for that you will have basically iterate through the XML and then create elements via code and place on the viewController. You might also want to add some frame dimensions and/or palcement details so that the elements can be displayed.

cheers,

Jayant