Skip to content

Commit ae906a5

Browse files
author
lianchen
committed
Revert "优化代理方法"
This reverts commit 629fb57.
1 parent 629fb57 commit ae906a5

12 files changed

+35
-28
lines changed

.DS_Store

-6 KB
Binary file not shown.

Example/.DS_Store

-6 KB
Binary file not shown.

Example/Demo/TestViewController2.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ - (instancetype)initWithOverallRefresh:(BOOL)isOverall;
4747

4848
- (void)dealloc
4949
{
50-
// NSLog(@"TestViewController2销毁");
50+
NSLog(@"TestViewController2销毁");
5151
}
5252

5353

Example/Demo/TestViewController3.m

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
6868
{
6969
[tableView deselectRowAtIndexPath:indexPath animated:YES];
7070
TestViewController2 *vc = [[TestViewController2 alloc] init];
71-
vc.title = @"示例2:内部刷新";
7271
[self.navigationController pushViewController:vc animated:YES];
7372

7473
}

Example/Demo/ViewController.m

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ @implementation ViewController
2424
- (void)viewDidLoad {
2525
[super viewDidLoad];
2626
[self setupExample];
27-
NSLog(@"初始化完成");
27+
NSLog(@"完成");
2828
}
2929

3030
- (void)setupExample
@@ -51,11 +51,9 @@ - (void)btnDidClick:(UIButton *)btn
5151
{
5252
if (btn.tag == 1) {
5353
TestViewController2 *vc = [[TestViewController2 alloc] initWithOverallRefresh:YES];
54-
vc.title = @"示例1:整体刷新";
5554
[self.navigationController pushViewController:vc animated:YES];
5655
}else if (btn.tag == 2) {
5756
TestViewController2 *vc = [[TestViewController2 alloc] init];
58-
vc.title = @"示例2:内部刷新";
5957
[self.navigationController pushViewController:vc animated:YES];
6058
}
6159
}

Example/Example.xcodeproj/project.pbxproj

+14-20
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
9DA53F1720AE69FE00DA0D0E /* LCHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA53F1620AE69FE00DA0D0E /* LCHeadView.m */; };
11-
9DA53F1A20AE6A9000DA0D0E /* LCTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA53F1820AE6A9000DA0D0E /* LCTitleView.m */; };
12-
9DA53F1E20AE6AC200DA0D0E /* LCPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA53F1C20AE6AC200DA0D0E /* LCPageView.m */; };
1310
C857065020ADAF9E00397593 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C857064F20ADAF9E00397593 /* AppDelegate.m */; };
1411
C857065620ADAF9E00397593 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C857065420ADAF9E00397593 /* Main.storyboard */; };
1512
C857065820ADAF9F00397593 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C857065720ADAF9F00397593 /* Assets.xcassets */; };
1613
C857065B20ADAF9F00397593 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C857065920ADAF9F00397593 /* LaunchScreen.storyboard */; };
1714
C857065E20ADAF9F00397593 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C857065D20ADAF9F00397593 /* main.m */; };
15+
C857068520ADB08A00397593 /* LCTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = C857067820ADB08900397593 /* LCTitleView.m */; };
16+
C857068620ADB08A00397593 /* LCPageView.m in Sources */ = {isa = PBXBuildFile; fileRef = C857067920ADB08900397593 /* LCPageView.m */; };
1817
C857068720ADB08A00397593 /* UIViewController+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = C857067A20ADB08900397593 /* UIViewController+Category.m */; };
1918
C857068820ADB08A00397593 /* LCPageViewStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = C857067B20ADB08900397593 /* LCPageViewStyle.m */; };
2019
C857068920ADB08A00397593 /* MainScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = C857067D20ADB08A00397593 /* MainScrollView.m */; };
@@ -26,13 +25,6 @@
2625
/* End PBXBuildFile section */
2726

2827
/* Begin PBXFileReference section */
29-
9DA53F1520AE69FE00DA0D0E /* LCHeadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LCHeadView.h; sourceTree = "<group>"; };
30-
9DA53F1620AE69FE00DA0D0E /* LCHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LCHeadView.m; sourceTree = "<group>"; };
31-
9DA53F1820AE6A9000DA0D0E /* LCTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LCTitleView.m; sourceTree = "<group>"; };
32-
9DA53F1920AE6A9000DA0D0E /* LCTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCTitleView.h; sourceTree = "<group>"; };
33-
9DA53F1B20AE6AAE00DA0D0E /* LCPageContentViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCPageContentViewProtocol.h; sourceTree = "<group>"; };
34-
9DA53F1C20AE6AC200DA0D0E /* LCPageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LCPageView.m; sourceTree = "<group>"; };
35-
9DA53F1D20AE6AC200DA0D0E /* LCPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCPageView.h; sourceTree = "<group>"; };
3628
C857064B20ADAF9E00397593 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
3729
C857064E20ADAF9E00397593 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
3830
C857064F20ADAF9E00397593 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
@@ -41,9 +33,14 @@
4133
C857065A20ADAF9F00397593 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4234
C857065C20ADAF9F00397593 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4335
C857065D20ADAF9F00397593 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
36+
C857067820ADB08900397593 /* LCTitleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LCTitleView.m; sourceTree = "<group>"; };
37+
C857067920ADB08900397593 /* LCPageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LCPageView.m; sourceTree = "<group>"; };
4438
C857067A20ADB08900397593 /* UIViewController+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+Category.m"; sourceTree = "<group>"; };
4539
C857067B20ADB08900397593 /* LCPageViewStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LCPageViewStyle.m; sourceTree = "<group>"; };
40+
C857067C20ADB08900397593 /* LCTitleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCTitleView.h; sourceTree = "<group>"; };
4641
C857067D20ADB08A00397593 /* MainScrollView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainScrollView.m; sourceTree = "<group>"; };
42+
C857067E20ADB08A00397593 /* LCPageContentViewProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCPageContentViewProtocol.h; sourceTree = "<group>"; };
43+
C857067F20ADB08A00397593 /* LCPageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LCPageView.h; sourceTree = "<group>"; };
4744
C857068020ADB08A00397593 /* UIScrollView+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+Category.h"; sourceTree = "<group>"; };
4845
C857068120ADB08A00397593 /* UIScrollView+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+Category.m"; sourceTree = "<group>"; };
4946
C857068220ADB08A00397593 /* UIViewController+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+Category.h"; sourceTree = "<group>"; };
@@ -105,21 +102,19 @@
105102
C857066420ADB04500397593 /* Source */ = {
106103
isa = PBXGroup;
107104
children = (
108-
9DA53F1D20AE6AC200DA0D0E /* LCPageView.h */,
109-
9DA53F1C20AE6AC200DA0D0E /* LCPageView.m */,
110-
9DA53F1920AE6A9000DA0D0E /* LCTitleView.h */,
111-
9DA53F1820AE6A9000DA0D0E /* LCTitleView.m */,
112-
9DA53F1520AE69FE00DA0D0E /* LCHeadView.h */,
113-
9DA53F1620AE69FE00DA0D0E /* LCHeadView.m */,
105+
C857067E20ADB08A00397593 /* LCPageContentViewProtocol.h */,
106+
C857067F20ADB08A00397593 /* LCPageView.h */,
107+
C857067920ADB08900397593 /* LCPageView.m */,
114108
C857068320ADB08A00397593 /* LCPageViewStyle.h */,
115109
C857067B20ADB08900397593 /* LCPageViewStyle.m */,
110+
C857067C20ADB08900397593 /* LCTitleView.h */,
111+
C857067820ADB08900397593 /* LCTitleView.m */,
116112
C857068420ADB08A00397593 /* MainScrollView.h */,
117113
C857067D20ADB08A00397593 /* MainScrollView.m */,
118114
C857068020ADB08A00397593 /* UIScrollView+Category.h */,
119115
C857068120ADB08A00397593 /* UIScrollView+Category.m */,
120116
C857068220ADB08A00397593 /* UIViewController+Category.h */,
121117
C857067A20ADB08900397593 /* UIViewController+Category.m */,
122-
9DA53F1B20AE6AAE00DA0D0E /* LCPageContentViewProtocol.h */,
123118
);
124119
name = Source;
125120
path = ../../Source;
@@ -211,16 +206,15 @@
211206
buildActionMask = 2147483647;
212207
files = (
213208
C857069A20ADB22400397593 /* TestTitleView.m in Sources */,
214-
9DA53F1720AE69FE00DA0D0E /* LCHeadView.m in Sources */,
209+
C857068520ADB08A00397593 /* LCTitleView.m in Sources */,
215210
C857069920ADB22400397593 /* TestViewController2.m in Sources */,
216211
C857068A20ADB08A00397593 /* UIScrollView+Category.m in Sources */,
217212
C857068920ADB08A00397593 /* MainScrollView.m in Sources */,
218-
9DA53F1A20AE6A9000DA0D0E /* LCTitleView.m in Sources */,
219213
C857065E20ADAF9F00397593 /* main.m in Sources */,
220214
C857069720ADB22400397593 /* ViewController.m in Sources */,
221215
C857069620ADB22400397593 /* TestViewController3.m in Sources */,
222216
C857068820ADB08A00397593 /* LCPageViewStyle.m in Sources */,
223-
9DA53F1E20AE6AC200DA0D0E /* LCPageView.m in Sources */,
217+
C857068620ADB08A00397593 /* LCPageView.m in Sources */,
224218
C857068720ADB08A00397593 /* UIViewController+Category.m in Sources */,
225219
C857065020ADAF9E00397593 /* AppDelegate.m in Sources */,
226220
);

Source/LCHeadView.m

+7
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,12 @@
1010

1111
@implementation LCHeadView
1212

13+
/*
14+
// Only override drawRect: if you perform custom drawing.
15+
// An empty implementation adversely affects performance during animation.
16+
- (void)drawRect:(CGRect)rect {
17+
// Drawing code
18+
}
19+
*/
1320

1421
@end

Source/LCPageContentViewProtocol.h

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
@protocol LCPageContentViewProtocol <NSObject>
1212

13-
#pragma mark - titleView 代理方法
1413
/// 即将开始拖拽
1514
- (void)lc_scrollViewWillBeginDragging:(UICollectionView *)collectionView;
1615

Source/LCPageView.m

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
// Created by 复新会智 on 2018/5/9.
66
// Copyright © 2018年 复新会智. All rights reserved.
77
//
8+
/// 标题的高度
9+
#define kPageViewTitleHeight 38
10+
811

912
//屏幕尺寸
1013
#define kScreenBounds [UIScreen mainScreen].bounds

Source/LCTitleView.m

+4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ - (void)didMoveToSuperview
5252
UIView *superV = [self getLCPageViewWithCurrentView:self];
5353
if ([superV isKindOfClass:[LCPageView class]]) {
5454
[superV performSelector:@selector(setContentViewDelegate:) withObject:self];
55+
// LCPageView *v = (LCPageView *)superV;
56+
// id<LCPageContentViewProtocol> delegate = [v valueForKey:@"contentScrollDelegate"];
57+
// delegate = self;
58+
// v.contentScrollDelegate = self;
5559
}
5660
}
5761

Source/MainScrollView.m

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecogni
2020
return ([gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] &&
2121
[otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]);
2222
}
23-
23+
- (void)dealloc
24+
{
25+
// NSLog(@"MainScrollView销毁");
26+
}
2427
@end

Source/UIScrollView+Category.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
typedef void(^LCScrollHandle)(UIScrollView *);
1111

1212
@interface UIScrollView (Category)
13-
/** 滚动回调 */
13+
/** 滚动代理 */
1414
@property(nonatomic, copy) LCScrollHandle scrollHandle;
1515
@end

0 commit comments

Comments
 (0)