Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Demone Kim
2,151 PointsHello fellow programmers. I'm building a simple tableview app as a guide for a video game. Need help!!!
I'm building a simple tableview app in swift. I feel as if the data is too congested. I have all the data on the main view controller and it shows the data under the viewdidload method. i.e.override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib.
firstTableArray = ["Getting Started","Second","Third"]
secondTableArray = [
SecondTable(secondTitle: ["Key Terms","Key Buildings","1-3"]),
SecondTable(secondTitle: ["2-1","2-2","2-3"]),
SecondTable(secondTitle: ["3-1","3-2","3-3"])]
thirdTableArray = [
ThirdView(thirdViewArray: ["asdf","dsfsadf","sdfasdf"]),
ThirdView(thirdViewArray: ["hjhjhjhj","hjhjhj","hjhjhj"]),
ThirdView(thirdViewArray: ["hjhjhk","hkhkhkhk","hkhhk"]) ]
I'd like to create a separate swift file called "Contents" and store all the data listed above in that file for better flow. How do I call the data from that file using the viewdidload method from the main storyboard?