You can imagine page-based navigation from code. You can specify as many pages as you want, but these pages must be designed in a storyboard
func presentControllerWithNames(names: [AnyObject], contexts: [AnyObject]?) // modal presentation of paged controllers. contexts matched to
Example
Present Page Interfaces for objects. This page shows the code for each object.
let objects = ["1", "2", "3", "4", "5"] let controllers = Array(count: objects.count, repeatedValue: "Page") presentControllerWithNames(controllers, contexts: objects)
Present a different interface to another object of the object.
let objects = [1, 2, 3, 4, 5] let controllers = objects.map { object in object % 2 == 0 ? "Even-Page" : "Odd-Page" } presentControllerWithNames(controllers, contexts: objects)
Kostiantyn koval
source share