Skip to content

Commit b72d70f

Browse files
committed
引导页
1 parent 1ff2266 commit b72d70f

8 files changed

Lines changed: 280 additions & 0 deletions

File tree

BABaseProject.xcodeproj/project.pbxproj

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@
396396
C4EE1C611D228AE9005046A6 /* DemoVC2_01_Model.m in Sources */ = {isa = PBXBuildFile; fileRef = C4EE1C601D228AE9005046A6 /* DemoVC2_01_Model.m */; };
397397
C4EE1C651D228E34005046A6 /* NSString+BAKit.m in Sources */ = {isa = PBXBuildFile; fileRef = C4EE1C641D228E34005046A6 /* NSString+BAKit.m */; };
398398
C4EE1C691D2295E2005046A6 /* BACellDataAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = C4EE1C681D2295E2005046A6 /* BACellDataAdapter.m */; };
399+
C4F59F871D54680E00AA822A /* BANewFeatureVC.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F59F861D54680E00AA822A /* BANewFeatureVC.m */; };
400+
C4F59F8A1D54684E00AA822A /* BAADScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F59F891D54684E00AA822A /* BAADScrollView.m */; };
401+
C4F59F8D1D5468B900AA822A /* BAADLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F59F8C1D5468B900AA822A /* BAADLabel.m */; };
399402
C4F74A881D37BDEB0014C396 /* BAClearCacheManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F74A871D37BDEB0014C396 /* BAClearCacheManager.m */; };
400403
C4F74A9C1D37C1BD0014C396 /* BALocalNotification.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F74A8B1D37C1BD0014C396 /* BALocalNotification.m */; };
401404
C4F74A9D1D37C1BD0014C396 /* BACustomBarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F74A8E1D37C1BD0014C396 /* BACustomBarItem.m */; };
@@ -990,6 +993,12 @@
990993
C4EE1C641D228E34005046A6 /* NSString+BAKit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+BAKit.m"; sourceTree = "<group>"; };
991994
C4EE1C671D2295E2005046A6 /* BACellDataAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BACellDataAdapter.h; sourceTree = "<group>"; };
992995
C4EE1C681D2295E2005046A6 /* BACellDataAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BACellDataAdapter.m; sourceTree = "<group>"; };
996+
C4F59F851D54680E00AA822A /* BANewFeatureVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BANewFeatureVC.h; sourceTree = "<group>"; };
997+
C4F59F861D54680E00AA822A /* BANewFeatureVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BANewFeatureVC.m; sourceTree = "<group>"; };
998+
C4F59F881D54684E00AA822A /* BAADScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BAADScrollView.h; sourceTree = "<group>"; };
999+
C4F59F891D54684E00AA822A /* BAADScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BAADScrollView.m; sourceTree = "<group>"; };
1000+
C4F59F8B1D5468B900AA822A /* BAADLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BAADLabel.h; sourceTree = "<group>"; };
1001+
C4F59F8C1D5468B900AA822A /* BAADLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BAADLabel.m; sourceTree = "<group>"; };
9931002
C4F74A861D37BDEB0014C396 /* BAClearCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BAClearCacheManager.h; sourceTree = "<group>"; };
9941003
C4F74A871D37BDEB0014C396 /* BAClearCacheManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BAClearCacheManager.m; sourceTree = "<group>"; };
9951004
C4F74A8A1D37C1BD0014C396 /* BALocalNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BALocalNotification.h; sourceTree = "<group>"; };
@@ -2298,6 +2307,7 @@
22982307
isa = PBXGroup;
22992308
children = (
23002309
C4EB5AEC1CD8B24F003A7094 /* BACode */,
2310+
C4F59F811D5467C100AA822A /* BANewFeatures(新特性) */,
23012311
C4EB5AD71CD8B24F003A7094 /* BABaseData(基类) */,
23022312
C4EB5B0B1CD8B24F003A7094 /* BALib(三方库) */,
23032313
C4EB5B241CD8B24F003A7094 /* BATools(工具类) */,
@@ -2898,6 +2908,43 @@
28982908
path = BABaseCell;
28992909
sourceTree = "<group>";
29002910
};
2911+
C4F59F811D5467C100AA822A /* BANewFeatures(新特性) */ = {
2912+
isa = PBXGroup;
2913+
children = (
2914+
C4F59F841D5467C100AA822A /* ViewController */,
2915+
C4F59F821D5467C100AA822A /* Model */,
2916+
C4F59F831D5467C100AA822A /* View */,
2917+
);
2918+
path = "BANewFeatures(新特性)";
2919+
sourceTree = "<group>";
2920+
};
2921+
C4F59F821D5467C100AA822A /* Model */ = {
2922+
isa = PBXGroup;
2923+
children = (
2924+
);
2925+
path = Model;
2926+
sourceTree = "<group>";
2927+
};
2928+
C4F59F831D5467C100AA822A /* View */ = {
2929+
isa = PBXGroup;
2930+
children = (
2931+
C4F59F881D54684E00AA822A /* BAADScrollView.h */,
2932+
C4F59F891D54684E00AA822A /* BAADScrollView.m */,
2933+
C4F59F8B1D5468B900AA822A /* BAADLabel.h */,
2934+
C4F59F8C1D5468B900AA822A /* BAADLabel.m */,
2935+
);
2936+
path = View;
2937+
sourceTree = "<group>";
2938+
};
2939+
C4F59F841D5467C100AA822A /* ViewController */ = {
2940+
isa = PBXGroup;
2941+
children = (
2942+
C4F59F851D54680E00AA822A /* BANewFeatureVC.h */,
2943+
C4F59F861D54680E00AA822A /* BANewFeatureVC.m */,
2944+
);
2945+
path = ViewController;
2946+
sourceTree = "<group>";
2947+
};
29012948
C4F74A851D37BDB60014C396 /* 清理缓存 */ = {
29022949
isa = PBXGroup;
29032950
children = (
@@ -3467,6 +3514,7 @@
34673514
C46B8A041CE0BAC200005E2B /* RegexKitLite.m in Sources */,
34683515
C485562C1D3CB01700002FA2 /* UINavigationController+BAKit.m in Sources */,
34693516
C4EB5AA81CD8B04B003A7094 /* AppDelegate.m in Sources */,
3517+
C4F59F8A1D54684E00AA822A /* BAADScrollView.m in Sources */,
34703518
C430AB761CDC8A360086DDD6 /* DemoVC3.m in Sources */,
34713519
C42A6AE41CDAE10500D534EE /* BATabBarButton.m in Sources */,
34723520
C4EB5BBD1CD8B250003A7094 /* BAHomeViewController.m in Sources */,
@@ -3497,6 +3545,7 @@
34973545
C4F74A881D37BDEB0014C396 /* BAClearCacheManager.m in Sources */,
34983546
C445E1F51D1BF10A00D7654A /* DemoVC13.m in Sources */,
34993547
C480273C1D1928290087BBB9 /* NSMutableDictionary+BAKit.m in Sources */,
3548+
C4F59F871D54680E00AA822A /* BANewFeatureVC.m in Sources */,
35003549
C427812F1D2D39B1003E6694 /* GCDQueue.m in Sources */,
35013550
C4D108031CE2FC1C00F735B9 /* view2.m in Sources */,
35023551
C48027451D1928290087BBB9 /* UIColor+BAKit.m in Sources */,
@@ -3560,6 +3609,7 @@
35603609
C408527C1CD990B00004A671 /* BABaseTableViewController.m in Sources */,
35613610
C4C802511CF5AFAE00AD5B3B /* BAWebViewController.m in Sources */,
35623611
C40852E91CDA263B0004A671 /* RDVTabBar.m in Sources */,
3612+
C4F59F8D1D5468B900AA822A /* BAADLabel.m in Sources */,
35633613
C4EB5BD11CD8B250003A7094 /* UIViewController+BAAlertView.m in Sources */,
35643614
C42A6AE81CDAE10D00D534EE /* BATabBarController.m in Sources */,
35653615
C4F74A9D1D37C1BD0014C396 /* BACustomBarItem.m in Sources */,
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// BAADLabel.h
3+
// BABaseProject
4+
//
5+
// Created by boai on 16/8/5.
6+
// Copyright © 2016年 博爱之家. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface BAADLabel : UILabel
12+
13+
@end
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// BAADLabel.m
3+
// BABaseProject
4+
//
5+
// Created by boai on 16/8/5.
6+
// Copyright © 2016年 博爱之家. All rights reserved.
7+
//
8+
9+
#import "BAADLabel.h"
10+
11+
@implementation BAADLabel
12+
13+
- (instancetype)initWithFrame:(CGRect)frame
14+
{
15+
if (self = [super initWithFrame:frame])
16+
{
17+
self.bakit_manager
18+
.label_font([UIFont fontWithName:@"SFOuterLimitsUpright" size:20.0f])
19+
.label_textAlignment(NSTextAlignmentCenter)
20+
.label_textColor(BA_White_Color);
21+
}
22+
return self;
23+
}
24+
25+
@end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// BAADScrollView.h
3+
// BABaseProject
4+
//
5+
// Created by boai on 16/8/5.
6+
// Copyright © 2016年 博爱之家. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface BAADScrollView : UIScrollView
12+
13+
@property (nonatomic, strong) NSArray *titlesArray;
14+
@property (nonatomic, strong) UIPageControl *pageControl;
15+
16+
@end
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
//
2+
// BAADScrollView.m
3+
// BABaseProject
4+
//
5+
// Created by boai on 16/8/5.
6+
// Copyright © 2016年 博爱之家. All rights reserved.
7+
//
8+
9+
#import "BAADScrollView.h"
10+
#import "BAADLabel.h"
11+
12+
@interface BAADScrollView ()<UIScrollViewDelegate>
13+
14+
@property (nonatomic, strong) NSTimer *timer;
15+
16+
@end
17+
18+
@implementation BAADScrollView
19+
20+
- (instancetype)initWithFrame:(CGRect)frame
21+
{
22+
if (self = [super initWithFrame:frame])
23+
{
24+
self.delegate = self;
25+
self.scrollsToTop = NO;
26+
}
27+
return self;
28+
}
29+
30+
#pragma mark - ***** UIScrollViewDelegate
31+
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
32+
{
33+
CGFloat scrollW = self.bounds.size.width;
34+
int page = (scrollView.contentOffset.x + scrollW * 0.5) / scrollW;
35+
page --;
36+
self.pageControl.currentPage = page;
37+
}
38+
39+
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
40+
{
41+
42+
}
43+
44+
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
45+
{
46+
47+
}
48+
49+
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView
50+
{
51+
52+
}
53+
54+
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
55+
{
56+
57+
}
58+
59+
- (void)scrollViewDidStop:(UIScrollView *)scrollView
60+
{
61+
62+
}
63+
64+
#pragma mark - ***** setter / getter
65+
- (void)setTitlesArray:(NSArray *)titlesArray
66+
{
67+
_titlesArray = titlesArray;
68+
69+
self.pageControl.numberOfPages = titlesArray.count;
70+
[self ba_setBanner];
71+
}
72+
73+
- (void)ba_setBanner
74+
{
75+
[self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
76+
77+
CGFloat W = [UIScreen mainScreen].bounds.size.width;
78+
CGFloat H = 30;
79+
CGFloat Y = self.bounds.size.height - H;
80+
81+
BAADLabel *lastLabel = [[BAADLabel alloc] init];
82+
83+
BAADLabel *firstLabel = [[BAADLabel alloc] init];
84+
85+
for (int i = 0; i < self.titlesArray.count; i++) {
86+
87+
BAADLabel *advertLabel = [[BAADLabel alloc] init];
88+
89+
CGFloat X = i * W + W;
90+
advertLabel.frame = CGRectMake(X , Y, W, H);
91+
advertLabel.text = self.titlesArray[i];
92+
93+
if (i == 0) {
94+
firstLabel.text = self.titlesArray[i];
95+
}
96+
if (i == self.titles.count - 1) {
97+
lastLabel.text = self.titlesArray[i];
98+
}
99+
[self addSubview:advertLabel];
100+
}
101+
102+
lastLabel.frame = CGRectMake(0, Y, W, H);
103+
[self addSubview:lastLabel];
104+
105+
firstLabel.frame = CGRectMake((self.titles.count + 1) * W, Y, W, H);
106+
[self addSubview:firstLabel];
107+
108+
CGFloat contentW = (self.titles.count + 2) * W;
109+
self.contentSize = CGSizeMake(contentW, 0);
110+
111+
self.showsHorizontalScrollIndicator = NO;
112+
113+
self.pagingEnabled = YES;
114+
115+
self.pageControl.currentPage = 0;
116+
117+
[self setContentOffset:CGPointMake(W, 0)];
118+
119+
[self addTimer];
120+
121+
}
122+
123+
124+
125+
126+
@end
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//
2+
// BANewFeatureVC.h
3+
// BABaseProject
4+
//
5+
// Created by boai on 16/8/5.
6+
// Copyright © 2016年 博爱之家. All rights reserved.
7+
//
8+
9+
#import "BABaseViewController.h"
10+
11+
@interface BANewFeatureVC : BABaseViewController
12+
13+
@end
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// BANewFeatureVC.m
3+
// BABaseProject
4+
//
5+
// Created by boai on 16/8/5.
6+
// Copyright © 2016年 博爱之家. All rights reserved.
7+
//
8+
9+
#import "BANewFeatureVC.h"
10+
11+
@interface BANewFeatureVC ()
12+
13+
@end
14+
15+
@implementation BANewFeatureVC
16+
17+
- (void)viewDidLoad {
18+
[super viewDidLoad];
19+
// Do any additional setup after loading the view.
20+
}
21+
22+
- (void)didReceiveMemoryWarning {
23+
[super didReceiveMemoryWarning];
24+
// Dispose of any resources that can be recreated.
25+
}
26+
27+
/*
28+
#pragma mark - Navigation
29+
30+
// In a storyboard-based application, you will often want to do a little preparation before navigation
31+
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
32+
// Get the new view controller using [segue destinationViewController].
33+
// Pass the selected object to the new view controller.
34+
}
35+
*/
36+
37+
@end

0 commit comments

Comments
 (0)