Reputation: 545
I've downloaded a calendar app's source code form Github. The app has a CalendarViewController that contains a child UIView (called calendarView).
This has multiple classes (CalendarDayView, CalendarMonthView etc. etc. and the protocols are also written for some of the classes)
I have integrated this calendar app into my custom iPhone app, that has a TableViewController. The rest of the information is given in the image.
Notes:
Upvotes: 1
Views: 63
Reputation: 6272
This is totally fine. Just ensure that your have two instances of CalendarViewController
.
For example, when you instantiate your navigation controller you have:
let calendar1 = CalendarViewController()
let navC = UINavigationController(rootViewController:calendar1)
And then when a button is clicked in your TableViewController
:
let calendar2 = CalendarViewController()
self.navigationController.pushViewController(calendar2,animated:true)
Because you are making two initialisations, each CalendarViewController
will be a completely separate object and setting some variables on one of them will not result in that variable being updated in the second one.
Upvotes: 1