kitasuke / PagingMenuController

Paging view controller with customizable menu in Swift
MIT License
2.49k stars 448 forks source link

How to pass variable from root UIViewController to child UIViewController? #342

Closed kevinlee85 closed 7 years ago

kevinlee85 commented 7 years ago

How to pass variable from root UIViewController to child UIViewController?

struct PagingMenuOptions: PagingMenuControllerCustomizable { var componentType: ComponentType { let notificationPage_Booking = TabBarNotificationsViewController.StoryBoardInstance()! notificationPage_Booking.contextType = NotificationPageType.Booking let notificationPage_Payment = TabBarNotificationsViewController.StoryBoardInstance()! notificationPage_Payment.contextType = NotificationPageType.Payment return .all(menuOptions: MenuOptions(), pagingControllers: [notificationPage_Booking, notificationPage_Payment]) } }

I would like to pass one of vaiable from UIViewConroller to the notificationPage_Booking? How can I do it?

kevinlee85 commented 7 years ago

I got it, its Protocol type code. Let me add new variable to the customed Struct, then assign the variable on it.