in Education by
I have a base View Controller with various containers inside it. I use them to control the current step on a process, and only one of them is visible at a time. I created a enum for the steps, and use it's Int rawValue to access the containers corresponding to each step by tag, changing its visibility. But at some points I have to pass some information to one or more of the step controllers. I was thinking using the same enum approach to access the position of the corresponding View Controller in the childViewControllers array to do that. Problem is, I haven't found anything in the documentation that ensures me that the childViewControllers array is always at the same order, so I can use this approach. Does anyone knows it or have a better way achieve something similar? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Maybe would be better to keep order manually, for example by creating Array variable which would be filled with references for your containers/controllers in order which you need. Simply connect all container views to outlet collection and hide or unhide certain elements of it @IBOutlet var containers: [UIView]! containers[0].isHidden = true containers[1].isHidden = false For keeping order of controllers just create array variable and fill it with controllers' references. If you're using segues, append destinations of embed segues. If you're adding child controllers by addChild(_:), simply append controllers which you're adding var controllers: [UIViewController]

Related questions

0 votes
    I have an array in one view controller that I want to send to two other view controllers - i am ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    I have an array in one view controller that I want to send to two other view controllers - i am ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 14, 2022 in Education by JackTerrance
0 votes
    I have an array in one view controller that I want to send to two other view controllers - i am ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 6, 2022 in Education by JackTerrance
0 votes
    So the scenario is the following: I have multiple instances of a web service that writes a blob of data to ... other unknown issues? Select the correct answer from above options...
asked Jan 31, 2022 in Education by JackTerrance
0 votes
    I am facing a problem that makes me to waste a lot of time. Each time I insert an element on a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I am facing a problem that makes me to waste a lot of time. Each time I insert an element on a ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 10, 2022 in Education by JackTerrance
0 votes
    In Ruby on Rails Development (or MVC in general), what quick rule should I follow as to where to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 31, 2022 in Education by JackTerrance
0 votes
    I've managed to read some values into a table view and display them in the Master View of a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I'm encountering some problems in integrating segue and protocols while implementing a selection list. In my ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    Which of the unit operation is used in Model view controller? (a) Is a Decomposition (b) Part ... Answers, Database Interview Questions and Answers for Freshers and Experience...
asked Oct 11, 2021 in Education by JackTerrance
0 votes
    I am trying to sort an array of objects by the name field but the ordering is wrong. The order I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 5, 2022 in Education by JackTerrance
0 votes
    _________ view is used to change the form design , apperance and size of various controls Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    _________ view is used to change the form design , apperance and size of various controls Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Find out various Supreme Court cases that have focused on the rights and liberty of Indian citizens. Please answer the above question....
asked Aug 3, 2022 in Education by JackTerrance
...