Creating a UIViewController programmatically based on json response

Assume my json will be

{ {"CategoryID" : "1 Month Premium"}, {"CategoryID" : "1 Year Premium"}, {"CategoryID" : "1 Week Premium"}, {"CategoryID" : "1 Day Premium"}, ....Dynamically created server data. } 

And I'm going to use the PagingMenuController from this library: PagingMenuController

The JSON-based base that I described above, the Category will be different, they can be 4 or 5 or more or less. So its dynamics.

This is how I will develop

enter image description here

As you can see, I will show CategoryID on PagingMenu. The entire view manager inside each page menu has common elements:

UITableView, UIImageView, UIButton

So, how do I create a UIViewController that has common elements and actions on each view and inserts it into my page controller. I really need help with this. I do not know how to do this programmatically. This is more like a Google Store game, whose menu is created dynamically.

Any help? All my life I used only a storyboard and a controller. Now I really need help.

0
uiviewcontroller swift xib
source share
1 answer

Complete the next tutorial. It is in objective-c, but it will help you understand the logic.

http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/

0
source share

All Articles