I have this objective-c method that i'm trying to re-write to swift.
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
int index = [navigationController.viewControllers indexOfObject:viewController];
self.pageControl.currentPage = index;
}
I'm having difficulties writing this line in swift:
int index = [navigationController.viewControllers indexOfObject:viewController];
How do i access the IndexOfObject?