Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilter Cengiz committed Mar 3, 2014
2 parents fac93e3 + 321a28d commit 1fe2346
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
xcuserdata/
project.xcworkspace/
.idea/
2 changes: 1 addition & 1 deletion ICViewPager.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Pod::Spec.new do |s|
s.screenshots = "https://dl.dropboxusercontent.com/u/17948706/Resources/SS.png"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Ilter Cengiz" => "[email protected]" }
s.platform = :ios, '6.1'
s.platform = :ios, '6.0'
s.source = { :git => "https://github.com/monsieurje/ICViewPager.git", :tag => "1.5" }
s.source_files = 'ICViewPager/ICViewPager/*.{h,m}'
s.requires_arc = true
Expand Down
4 changes: 2 additions & 2 deletions ICViewPager.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ICViewPager/ICViewPager-Prefix.pch";
INFOPLIST_FILE = "ICViewPager/ICViewPager-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -314,7 +314,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "ICViewPager/ICViewPager-Prefix.pch";
INFOPLIST_FILE = "ICViewPager/ICViewPager-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand Down
20 changes: 16 additions & 4 deletions ICViewPager/ICViewPager/ViewPagerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,11 @@ - (IBAction)handleTapGesture:(id)sender {
UIView *tabView = tapGestureRecognizer.view;
__block NSUInteger index = [self.tabs indexOfObject:tabView];

// Select the tab
[self selectTabAtIndex:index];
//if Tap is not selected Tab(new Tab)
if (self.activeTabIndex != index) {
// Select the tab
[self selectTabAtIndex:index];
}
}

#pragma mark - Interface rotation
Expand Down Expand Up @@ -372,7 +375,9 @@ - (void)setActiveContentIndex:(NSUInteger)activeContentIndex {
[self.pageViewController setViewControllers:@[viewController]
direction:UIPageViewControllerNavigationDirectionForward
animated:NO
completion:nil];
completion:^(BOOL completed) {
weakSelf.animatingToTab = NO;
}];

} else if (!(activeContentIndex + 1 == self.activeContentIndex || activeContentIndex - 1 == self.activeContentIndex)) {

Expand All @@ -397,7 +402,9 @@ - (void)setActiveContentIndex:(NSUInteger)activeContentIndex {
[self.pageViewController setViewControllers:@[viewController]
direction:(activeContentIndex < self.activeContentIndex) ? UIPageViewControllerNavigationDirectionReverse : UIPageViewControllerNavigationDirectionForward
animated:YES
completion:nil];
completion:^(BOOL completed) {
weakSelf.animatingToTab = NO;
}];
}

// Clean out of sight contents
Expand Down Expand Up @@ -567,6 +574,11 @@ - (void)reloadData {
[self defaultSetup];
}
- (void)selectTabAtIndex:(NSUInteger)index {

if (index >= self.tabCount) {
return;
}

self.animatingToTab = YES;

// Set activeTabIndex
Expand Down

0 comments on commit 1fe2346

Please sign in to comment.