Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gabe.jimenez

macrumors newbie
Original poster
Apr 3, 2015
1
0
I have a question for you. I am new to this and need some advice here, The app I am making is one that has a list of over 150 items in a tableview, when you select an item a new MVC comes up and shows the picture, and has button that leads to another MVC that tells you about the item via modal. Each item describes what it contains, and the benefits, these are lengthy descriptions. So in your opinion should I make a new MVC for each description? Or can I dynamically pass in the description to that MVC, and if so where do I put all of the descriptions at so that I can pass in the information. What should I do? Thanks.
 
I have a question for you. I am new to this and need some advice here, The app I am making is one that has a list of over 150 items in a tableview, when you select an item a new MVC comes up and shows the picture, and has button that leads to another MVC that tells you about the item via modal. Each item describes what it contains, and the benefits, these are lengthy descriptions. So in your opinion should I make a new MVC for each description? Or can I dynamically pass in the description to that MVC, and if so where do I put all of the descriptions at so that I can pass in the information. What should I do? Thanks.

Create a named seque for this transition.

Then look at the prepareForSegue function. In this you can send information from one ViewController to another.

In SWIFT:
Code:
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
    var segueViewController = segue.destinationViewControler as! MySecondViewController
   mySecondViewController.someText = self.someText
}

'MySecondViewController' is the view controller the segue goes to.
'someText' would be a variable that exists in both view controllers.

Then in the viewDidAppear() function, copy the someText to the text field.
 
Last edited by a moderator:
This is often called a master-detail design or drill down UI.

Yes, you'll most likely make a new detail view controller for each level you drill down into the description. On iPad you might do it differently for the top level of detail view controllers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.