{"action":"created","issue":{"url":"https://api.github.com/repos/hons82/THSegmentedPager/issues/12","labels_url":"https://api.github.com/repos/hons82/THSegmentedPager/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/hons82/THSegmentedPager/issues/12/comments","events_url":"https://api.github.com/repos/hons82/THSegmentedPager/issues/12/events","html_url":"https://github.com/hons82/THSegmentedPager/issues/12","id":93983872,"number":12,"title":" the current page is not exactly right","user":{"login":"btxkenshin","id":1837666,"avatar_url":"https://avatars.githubusercontent.com/u/1837666?v=3","gravatar_id":"","url":"https://api.github.com/users/btxkenshin","html_url":"https://github.com/btxkenshin","followers_url":"https://api.github.com/users/btxkenshin/followers","following_url":"https://api.github.com/users/btxkenshin/following{/other_user}","gists_url":"https://api.github.com/users/btxkenshin/gists{/gist_id}","starred_url":"https://api.github.com/users/btxkenshin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btxkenshin/subscriptions","organizations_url":"https://api.github.com/users/btxkenshin/orgs","repos_url":"https://api.github.com/users/btxkenshin/repos","events_url":"https://api.github.com/users/btxkenshin/events{/privacy}","received_events_url":"https://api.github.com/users/btxkenshin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-09T07:59:06Z","updated_at":"2015-07-13T07:40:30Z","closed_at":null,"body":"follow this:\r\n1. turn to `page 2`\r\n2. use two fingers to do this: scroll to `page 1`,but not leave your finger, until over `page 1`, which means you have see the background color.\r\n3. then leave your fingers.\r\n\r\nYou will see the view controller is `page 1`,but the top bar still stoped with `page 2`"},"comment":{"url":"https://api.github.com/repos/hons82/THSegmentedPager/issues/comments/120839375","html_url":"https://github.com/hons82/THSegmentedPager/issues/12#issuecomment-120839375","issue_url":"https://api.github.com/repos/hons82/THSegmentedPager/issues/12","id":120839375,"user":{"login":"hons82","id":2573013,"avatar_url":"https://avatars.githubusercontent.com/u/2573013?v=3","gravatar_id":"","url":"https://api.github.com/users/hons82","html_url":"https://github.com/hons82","followers_url":"https://api.github.com/users/hons82/followers","following_url":"https://api.github.com/users/hons82/following{/other_user}","gists_url":"https://api.github.com/users/hons82/gists{/gist_id}","starred_url":"https://api.github.com/users/hons82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hons82/subscriptions","organizations_url":"https://api.github.com/users/hons82/orgs","repos_url":"https://api.github.com/users/hons82/repos","events_url":"https://api.github.com/users/hons82/events{/privacy}","received_events_url":"https://api.github.com/users/hons82/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T07:40:30Z","updated_at":"2015-07-13T07:40:30Z","body":"The problem seems to be [this](http://stackoverflow.com/questions/24266420/uipageviewcontroller-didfinishanimating-not-called-if-swiped-quickly) and the solution provided is not what I want to implement.\r\n\r\nA possible solution could be to set the selected tab before the transition actually finishes. So instead of setting it in \r\n```Objective-C\r\n- (void)pageViewController:(UIPageViewController *)viewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed {\r\n    if (completed){\r\n        [self.pageControl setSelectedSegmentIndex:[self.pages indexOfObject:[viewController.viewControllers lastObject]] animated:YES];\r\n    }\r\n}\r\n``` \r\nI'll push a solution that does it like this\r\n```Objective-C\r\n- (void)pageViewController:(UIPageViewController *)pageViewController willTransitionToViewControllers:(NSArray *)pendingViewControllers {\r\n    [self.pageControl setSelectedSegmentIndex:[self.pages indexOfObject:[pendingViewControllers lastObject]] animated:YES];\r\n}\r\n```"}}