Snapchat-Swipe-View loads all of the viewControllers and views into scrollView of SnapContainerViewController at once.
All of the viewControllers are childViewController of SnapContainerViewController.
therefore
all viewControllers will received viewDidLoad and viewDidAppear at once
technically all viewControllers are already at "appear" state, it won't call "viewDidAppear" again before "viewDidDisappear"
paging change(switching view to on-screen) can be identified from scrolling event.
Example to identify which viewController is on-screen (for horizontal scrollview with index 0, 1, 2)
Similar handling for vertical scrollView.
Simply add the following callback method in SnapContainerViewController.swift
extension SnapContainerViewController: UIScrollViewDelegate {
func scrollViewDidEndDecelerating(scrollView: UIScrollView){
let fullWidth = scrollView.frame.size.width
let pageNo: NSInteger = lround(Double(scrollView.contentOffset.x / fullWidth))
print("page is shown:", pageNo)
}