Creating UIViewController programmatically base on

2019-09-07 17:36发布

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 gonna use PagingMenuController from this library : PagingMenuController

Base on the JSON which I described above, Category will be different,they may be 4 or 5,or more or less.So,Its dynamic.

This is how I gonna develope

enter image description here

As you can see,I will display CategoryID on PagingMenu.All the viewcontroller inside each page menu have common items :

UITableView,UIImageView,UIButton

So,how do i create UIViewController which have common items and actions on each view and insert to my page controller.I really need help with that.I don't know how to do it programatically.It was more like google play store app which page menu are created dynamically.

Any Help?Please,all my life,I used only storyboard and view controller.From now,I really need help.

1条回答
聊天终结者
2楼-- · 2019-09-07 18:01

Go through following tutorial. It is in objective-c but it will help you to understand the logic.

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

查看更多
登录 后发表回答