简体   繁体   中英

Making UI elements programmatically in iOS using Xcode in Objective-C

I am trying to parse json data and convert it to form in iOS. I am successfully able to parse data and display it, however, i want to fix the UI and make it look more like an iOS form, perhaps using tableviews, etc.

How do I approach this? should I just use a tableviewController or use a tableview? (the fields are dynamically added, so I have no idea what type and how many fields I will have, until I make a call to the API and fetch the data from the json that I get)

Are there any easy to use libraries in iOS that I can use?

That's not how UI design works on iOS. For the specific example that you mentioned of a tableViewController getting fed from an API... You'll create a tableViewController and you will design a demo cell.

Then you will fetch the results from your API, parse it. And you will iterate over the results returned by the API, inside that iteration you will programatically create the table cells (thus ensuring that you are creating as many tables as you need).

Nevertheless this is a extremely vague question, and besides briefly explaining how this whole thing works on general terms, there is not much more I can do without you posting the code you have so far.

Allow me to refer you to this tutorial by NSCookBook that although old is gold when it comes to these things.

Regards,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM