reading from the link you provided yourself it has:
// Array to keep track of controllers in page menu
var controllerArray : [UIViewController] = []
// Create variables for all view controllers you want to put in the
// page menu, initialize them, and add each to the controller array.
// (Can be any UIViewController subclass)
// Make sure the title property of all view controllers is set
// Example:
var controller : UIViewController = UIViewController(nibName: "controllerNibName", bundle: nil)
controller.title = "SAMPLE TITLE"
controllerArray.append(controller)
So what you have to do is : have a function that returns a [dailyModel]
.
Your dailyModel would look something like this:
struct dailyModel {
let programStartingTime : String // 6:45
let item : [item] // [(Maghrib & Isha Prayer, 20, 0),(Ziarat-e-Ashura, 20, 1), ...otherItems...]
}
struct item{
let duration : Int? //minutes
let name : String // Maghrib and Isha prayers
let row : Int? // 0
}
Then loop through that dailyModel
and using its parameters you instantiate & populate viewcontroller and then append
each of them as the tutorial is doing.
This isn't the best code but I hope you get the idea.