Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit 0f0d1fc

Browse files
committed
initial version
1 parent a87155a commit 0f0d1fc

23 files changed

+1858
-91
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Example/SimpleExample/SimpleExample.xcodeproj/xcuserdata
2+
ARTableViewPagerWorkspace.xcworkspace/xcuserdata
3+
ARTableViewPager.xcodeproj/xcuserdata
4+
ARTableViewPager.xcodeproj/project.xcworkspace/xcuserdata

ARTableViewPager.xcodeproj/project.pbxproj

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,31 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
D77AE4BC1511E935007DB396 /* ARPagingTablePageControl.m in Sources */ = {isa = PBXBuildFile; fileRef = D77AE4B61511E935007DB396 /* ARPagingTablePageControl.m */; };
11+
D77AE4BD1511E935007DB396 /* ARPagingTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D77AE4B71511E935007DB396 /* ARPagingTableView.m */; };
12+
D77AE4BE1511E935007DB396 /* ARPagingTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D77AE4B81511E935007DB396 /* ARPagingTableViewController.m */; };
13+
D77AE4C01511EA5A007DB396 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D77AE4BF1511EA5A007DB396 /* main.m */; };
1014
D7E0D561150FC32D00DFC6C8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D7E0D560150FC32D00DFC6C8 /* UIKit.framework */; };
1115
D7E0D563150FC32D00DFC6C8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D7E0D562150FC32D00DFC6C8 /* Foundation.framework */; };
1216
D7E0D565150FC32D00DFC6C8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D7E0D564150FC32D00DFC6C8 /* CoreGraphics.framework */; };
1317
D7E0D56B150FC32D00DFC6C8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = D7E0D569150FC32D00DFC6C8 /* InfoPlist.strings */; };
14-
D7E0D56D150FC32D00DFC6C8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E0D56C150FC32D00DFC6C8 /* main.m */; };
15-
D7E0D571150FC32D00DFC6C8 /* ARAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D7E0D570150FC32D00DFC6C8 /* ARAppDelegate.m */; };
1618
/* End PBXBuildFile section */
1719

1820
/* Begin PBXFileReference section */
21+
D77AE4B61511E935007DB396 /* ARPagingTablePageControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARPagingTablePageControl.m; path = Classes/ARPagingTablePageControl.m; sourceTree = SOURCE_ROOT; };
22+
D77AE4B71511E935007DB396 /* ARPagingTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARPagingTableView.m; path = Classes/ARPagingTableView.m; sourceTree = SOURCE_ROOT; };
23+
D77AE4B81511E935007DB396 /* ARPagingTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ARPagingTableViewController.m; path = Classes/ARPagingTableViewController.m; sourceTree = SOURCE_ROOT; };
24+
D77AE4B91511E935007DB396 /* ARPagingTablePageControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARPagingTablePageControl.h; path = Classes/ARPagingTablePageControl.h; sourceTree = SOURCE_ROOT; };
25+
D77AE4BA1511E935007DB396 /* ARPagingTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARPagingTableView.h; path = Classes/ARPagingTableView.h; sourceTree = SOURCE_ROOT; };
26+
D77AE4BB1511E935007DB396 /* ARPagingTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARPagingTableViewController.h; path = Classes/ARPagingTableViewController.h; sourceTree = SOURCE_ROOT; };
27+
D77AE4BF1511EA5A007DB396 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
1928
D7E0D55C150FC32D00DFC6C8 /* ARTableViewPager.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ARTableViewPager.app; sourceTree = BUILT_PRODUCTS_DIR; };
2029
D7E0D560150FC32D00DFC6C8 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
2130
D7E0D562150FC32D00DFC6C8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
2231
D7E0D564150FC32D00DFC6C8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
23-
D7E0D568150FC32D00DFC6C8 /* ARTableViewPager-Info.plist */ = {isa = PBXFileReference; path = "ARTableViewPager-Info.plist"; sourceTree = "<group>"; };
32+
D7E0D568150FC32D00DFC6C8 /* ARTableViewPager-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ARTableViewPager-Info.plist"; sourceTree = "<group>"; };
2433
D7E0D56A150FC32D00DFC6C8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
25-
D7E0D56C150FC32D00DFC6C8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
26-
D7E0D56E150FC32D00DFC6C8 /* ARTableViewPager-Prefix.pch */ = {isa = PBXFileReference; path = "ARTableViewPager-Prefix.pch"; sourceTree = "<group>"; };
27-
D7E0D56F150FC32D00DFC6C8 /* ARAppDelegate.h */ = {isa = PBXFileReference; path = ARAppDelegate.h; sourceTree = "<group>"; };
28-
D7E0D570150FC32D00DFC6C8 /* ARAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ARAppDelegate.m; sourceTree = "<group>"; };
34+
D7E0D56E150FC32D00DFC6C8 /* ARTableViewPager-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ARTableViewPager-Prefix.pch"; sourceTree = "<group>"; };
2935
/* End PBXFileReference section */
3036

3137
/* Begin PBXFrameworksBuildPhase section */
@@ -46,6 +52,7 @@
4652
isa = PBXGroup;
4753
children = (
4854
D7E0D566150FC32D00DFC6C8 /* ARTableViewPager */,
55+
D7E0D567150FC32D00DFC6C8 /* Supporting Files */,
4956
D7E0D55F150FC32D00DFC6C8 /* Frameworks */,
5057
D7E0D55D150FC32D00DFC6C8 /* Products */,
5158
);
@@ -72,22 +79,26 @@
7279
D7E0D566150FC32D00DFC6C8 /* ARTableViewPager */ = {
7380
isa = PBXGroup;
7481
children = (
75-
D7E0D56F150FC32D00DFC6C8 /* ARAppDelegate.h */,
76-
D7E0D570150FC32D00DFC6C8 /* ARAppDelegate.m */,
77-
D7E0D567150FC32D00DFC6C8 /* Supporting Files */,
82+
D77AE4B91511E935007DB396 /* ARPagingTablePageControl.h */,
83+
D77AE4B61511E935007DB396 /* ARPagingTablePageControl.m */,
84+
D77AE4BA1511E935007DB396 /* ARPagingTableView.h */,
85+
D77AE4B71511E935007DB396 /* ARPagingTableView.m */,
86+
D77AE4BB1511E935007DB396 /* ARPagingTableViewController.h */,
87+
D77AE4B81511E935007DB396 /* ARPagingTableViewController.m */,
7888
);
7989
path = ARTableViewPager;
8090
sourceTree = "<group>";
8191
};
8292
D7E0D567150FC32D00DFC6C8 /* Supporting Files */ = {
8393
isa = PBXGroup;
8494
children = (
95+
D77AE4BF1511EA5A007DB396 /* main.m */,
8596
D7E0D568150FC32D00DFC6C8 /* ARTableViewPager-Info.plist */,
8697
D7E0D569150FC32D00DFC6C8 /* InfoPlist.strings */,
87-
D7E0D56C150FC32D00DFC6C8 /* main.m */,
8898
D7E0D56E150FC32D00DFC6C8 /* ARTableViewPager-Prefix.pch */,
8999
);
90100
name = "Supporting Files";
101+
path = ARTableViewPager;
91102
sourceTree = "<group>";
92103
};
93104
/* End PBXGroup section */
@@ -152,8 +163,10 @@
152163
isa = PBXSourcesBuildPhase;
153164
buildActionMask = 2147483647;
154165
files = (
155-
D7E0D56D150FC32D00DFC6C8 /* main.m in Sources */,
156-
D7E0D571150FC32D00DFC6C8 /* ARAppDelegate.m in Sources */,
166+
D77AE4BC1511E935007DB396 /* ARPagingTablePageControl.m in Sources */,
167+
D77AE4BD1511E935007DB396 /* ARPagingTableView.m in Sources */,
168+
D77AE4BE1511E935007DB396 /* ARPagingTableViewController.m in Sources */,
169+
D77AE4C01511EA5A007DB396 /* main.m in Sources */,
157170
);
158171
runOnlyForDeploymentPostprocessing = 0;
159172
};
@@ -257,6 +270,7 @@
257270
D7E0D576150FC32D00DFC6C8 /* Release */,
258271
);
259272
defaultConfigurationIsVisible = 0;
273+
defaultConfigurationName = Release;
260274
};
261275
/* End XCConfigurationList section */
262276
};

ARTableViewPager.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ARTableViewPager/ARAppDelegate.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

ARTableViewPager/ARAppDelegate.m

Lines changed: 0 additions & 51 deletions
This file was deleted.

ARTableViewPager/main.m

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,7 @@
1-
//
2-
// main.m
3-
// ARTableViewPager
4-
//
5-
// Created by Jonas Stubenrauch on 13.03.12.
6-
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7-
//
81

92
#import <UIKit/UIKit.h>
103

11-
#import "ARAppDelegate.h"
12-
134
int main(int argc, char *argv[])
145
{
15-
@autoreleasepool {
16-
return UIApplicationMain(argc, argv, nil, NSStringFromClass([ARAppDelegate class]));
17-
}
6+
187
}

ARTableViewPagerWorkspace.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Classes/ARPagingTablePageControl.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
Copyright (c) 2012 arconsis IT-Solutions GmbH (http://www.arconsis.com)
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
5+
associated documentation files (the "Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
8+
following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all copies or substantial
11+
portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
14+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
15+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
16+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18+
*/
19+
20+
#import <UIKit/UIKit.h>
21+
22+
@interface ARPagingTablePageControl : UIPageControl
23+
24+
@property (nonatomic, strong) UIView *leftView;
25+
@property (nonatomic, strong) UIView *rightView;
26+
@property (nonatomic, strong) UIView *centerView;
27+
@property (nonatomic) BOOL showTitles;
28+
29+
@end

Classes/ARPagingTablePageControl.m

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
Copyright (c) 2012 arconsis IT-Solutions GmbH (http://www.arconsis.com)
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
5+
associated documentation files (the "Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
8+
following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all copies or substantial
11+
portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
14+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
15+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
16+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18+
*/
19+
20+
#import "ARPagingTablePageControl.h"
21+
22+
@implementation ARPagingTablePageControl
23+
24+
@synthesize leftView = _leftView;
25+
@synthesize rightView = _rightView;
26+
@synthesize centerView = _centerView;
27+
@synthesize showTitles = _showTitles;
28+
29+
- (void)setupViewHierachy {
30+
31+
float height = self.frame.size.height;
32+
float width = self.frame.size.width;
33+
34+
self.backgroundColor = [UIColor whiteColor];
35+
36+
self.leftView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 20, height)];
37+
self.rightView = [[UIView alloc] initWithFrame:CGRectMake(width - 20, 0, 20, height)];
38+
self.centerView = [[UIView alloc] initWithFrame:CGRectMake(20, 0, width - 40, height)];
39+
40+
self.leftView.backgroundColor = [UIColor clearColor];
41+
self.rightView.backgroundColor = [UIColor clearColor];
42+
self.centerView.backgroundColor = [UIColor clearColor];
43+
44+
self.leftView.autoresizesSubviews = YES;
45+
self.rightView.autoresizesSubviews = YES;
46+
self.centerView.autoresizesSubviews = YES;
47+
48+
// Used to hide the three dots if showTitles is set to YES
49+
self.leftView.tag = 900;
50+
self.rightView.tag = 901;
51+
self.centerView.tag = 902;
52+
53+
self.leftView.userInteractionEnabled = NO;
54+
self.rightView.userInteractionEnabled = NO;
55+
self.centerView.userInteractionEnabled = NO;
56+
57+
[self addSubview:self.leftView];
58+
[self addSubview:self.rightView];
59+
[self addSubview:self.centerView];
60+
}
61+
62+
63+
- (id)initWithFrame:(CGRect)frame {
64+
if ((self = [super initWithFrame:frame])) {
65+
[self setupViewHierachy];
66+
}
67+
return self;
68+
}
69+
70+
- (id)initWithCoder:(NSCoder *)aDecoder {
71+
if ((self = [super initWithCoder:aDecoder])) {
72+
[self setupViewHierachy];
73+
}
74+
return self;
75+
}
76+
77+
-(void)layoutSubviews {
78+
[super layoutSubviews];
79+
80+
if (self.showTitles) {
81+
NSArray *subviews = self.subviews;
82+
83+
// hides the three dots
84+
for (UIView *v in subviews) {
85+
if (v.tag < 900 || v.tag >= 1000) {
86+
v.hidden = YES;
87+
}
88+
}
89+
}
90+
91+
}
92+
93+
@end

Classes/ARPagingTableView.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Copyright (c) 2012 arconsis IT-Solutions GmbH (http://www.arconsis.com)
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
5+
associated documentation files (the "Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
8+
following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all copies or substantial
11+
portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
14+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
15+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
16+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18+
*/
19+
20+
#import <UIKit/UIKit.h>
21+
#import "ARPagingTablePageControl.h"
22+
23+
#define PAGECONTROL_DEFAULT_HEIGHT 36
24+
@protocol ARPagingTableViewChanged <NSObject>
25+
26+
- (void)pageChangedToTableView:(UITableView *)tableview withPageIndex:(NSUInteger)pageIndex;
27+
28+
@end
29+
30+
@interface ARPagingTableView : UIView <UIScrollViewDelegate>
31+
32+
@property (nonatomic, unsafe_unretained) id <ARPagingTableViewChanged> delegate;
33+
34+
@property (nonatomic, strong, readonly) ARPagingTablePageControl *pageControl;
35+
@property (nonatomic, strong, readonly) UIScrollView *scrollView;
36+
37+
// specify the content of the pageControle
38+
@property (nonatomic, strong) NSMutableArray *titleDefaultLabelStrings;
39+
@property (nonatomic, strong) NSMutableArray *titleViews; //overrides titleDetaultLabelStrings
40+
@property (nonatomic, strong) UIView *leftArrowView;
41+
@property (nonatomic, strong) UIView *rightArrowView;
42+
43+
@property (nonatomic, strong) UIColor *pageControlBackgroundColor;
44+
@property (nonatomic, strong) UIColor *scrollingBackgroundColor;
45+
@property (nonatomic, strong) UIColor *fixedBackgroundColor;
46+
@property (nonatomic, strong) UIColor *titleDefaultLabelColor;
47+
@property (nonatomic, strong) UIColor *arrowDefaultColor;
48+
49+
@property (nonatomic) BOOL hidePageControl;
50+
@property (nonatomic) float pageControlHeight;
51+
52+
- (void)initializeLayout;
53+
- (void)pageControlChangePage:(BOOL)animated;
54+
55+
@end

0 commit comments

Comments
 (0)