How do you access members between „slices“ and the viewcontroller?
Darko D.
21

Hi Darko! Thanks for reading.

Because of natural space constraints, I didn’t include everything related to Modlizer in this article, but there’s a minimalist solution for your problem in the APLoginData.swift file.

As you can see, there’s a class called APLoginData there and that’s the data model. The view controller holds a strong var to this called, usually, data (at least this is my preference). Inside this var, you can store arrays, lists, sets, whatever you need.

Because they are extensions, each slice communicates with the other ones, so the data object is available in the file which implements the UITableViewDataSource and UITableViewDelegate protocols.

Hope I was clear enough! Don’t hesitate if you have other questions 👍