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

Commit 1fe2346

Browse files
author
Ilter Cengiz
committed
2 parents fac93e3 + 321a28d commit 1fe2346

4 files changed

Lines changed: 20 additions & 7 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
xcuserdata/
23
project.xcworkspace/
34
.idea/

ICViewPager.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Pod::Spec.new do |s|
3131
s.screenshots = "https://dl.dropboxusercontent.com/u/17948706/Resources/SS.png"
3232
s.license = { :type => 'MIT', :file => 'LICENSE' }
3333
s.author = { "Ilter Cengiz" => "me@iltercengiz.info" }
34-
s.platform = :ios, '6.1'
34+
s.platform = :ios, '6.0'
3535
s.source = { :git => "https://github.com/monsieurje/ICViewPager.git", :tag => "1.5" }
3636
s.source_files = 'ICViewPager/ICViewPager/*.{h,m}'
3737
s.requires_arc = true

ICViewPager.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
GCC_PRECOMPILE_PREFIX_HEADER = YES;
301301
GCC_PREFIX_HEADER = "ICViewPager/ICViewPager-Prefix.pch";
302302
INFOPLIST_FILE = "ICViewPager/ICViewPager-Info.plist";
303-
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
303+
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
304304
PRODUCT_NAME = "$(TARGET_NAME)";
305305
WRAPPER_EXTENSION = app;
306306
};
@@ -314,7 +314,7 @@
314314
GCC_PRECOMPILE_PREFIX_HEADER = YES;
315315
GCC_PREFIX_HEADER = "ICViewPager/ICViewPager-Prefix.pch";
316316
INFOPLIST_FILE = "ICViewPager/ICViewPager-Info.plist";
317-
IPHONEOS_DEPLOYMENT_TARGET = 6.1;
317+
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
318318
PRODUCT_NAME = "$(TARGET_NAME)";
319319
WRAPPER_EXTENSION = app;
320320
};

ICViewPager/ICViewPager/ViewPagerController.m

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,11 @@ - (IBAction)handleTapGesture:(id)sender {
233233
UIView *tabView = tapGestureRecognizer.view;
234234
__block NSUInteger index = [self.tabs indexOfObject:tabView];
235235

236-
// Select the tab
237-
[self selectTabAtIndex:index];
236+
//if Tap is not selected Tab(new Tab)
237+
if (self.activeTabIndex != index) {
238+
// Select the tab
239+
[self selectTabAtIndex:index];
240+
}
238241
}
239242

240243
#pragma mark - Interface rotation
@@ -372,7 +375,9 @@ - (void)setActiveContentIndex:(NSUInteger)activeContentIndex {
372375
[self.pageViewController setViewControllers:@[viewController]
373376
direction:UIPageViewControllerNavigationDirectionForward
374377
animated:NO
375-
completion:nil];
378+
completion:^(BOOL completed) {
379+
weakSelf.animatingToTab = NO;
380+
}];
376381

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

@@ -397,7 +402,9 @@ - (void)setActiveContentIndex:(NSUInteger)activeContentIndex {
397402
[self.pageViewController setViewControllers:@[viewController]
398403
direction:(activeContentIndex < self.activeContentIndex) ? UIPageViewControllerNavigationDirectionReverse : UIPageViewControllerNavigationDirectionForward
399404
animated:YES
400-
completion:nil];
405+
completion:^(BOOL completed) {
406+
weakSelf.animatingToTab = NO;
407+
}];
401408
}
402409

403410
// Clean out of sight contents
@@ -567,6 +574,11 @@ - (void)reloadData {
567574
[self defaultSetup];
568575
}
569576
- (void)selectTabAtIndex:(NSUInteger)index {
577+
578+
if (index >= self.tabCount) {
579+
return;
580+
}
581+
570582
self.animatingToTab = YES;
571583

572584
// Set activeTabIndex

0 commit comments

Comments
 (0)