简体   繁体   中英

Dynamic view creation in iOS

I have deleted my storyboard. I have viewcontroller.h and viewcontroller.m file and also added another view controller called nextviewcontroller.h and nextviewcontroller.m .

I want to create a dynamic button in viewcontroller and then if I click that button it should move to the next viewcontroller.

I can create dynamic view and button in the first viewcontroller but I'm not able to do so in the second viewcontroller.

It sounds to me as if you want to implement your own "Container View Controller" in which case I recommend you read about this from Apple's documentation .

" I want to create a dynamic button in viewcontroller and then if I click that button it should move next view controller "

I assume you want the parent to know you want to move to another view, correct? I'll put an example on github.

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