Skip to content

Commit

Permalink
Pull down to refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
Liqiankun committed Apr 16, 2017
1 parent 80e0a70 commit 70f0996
Show file tree
Hide file tree
Showing 34 changed files with 477 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
AAB80F7F1EA302D400CD17FD /* DLWallPaperView.m in Sources */ = {isa = PBXBuildFile; fileRef = AAB80F7E1EA302D400CD17FD /* DLWallPaperView.m */; };
AAB80F811EA303C000CD17FD /* DLWallPaperView.xib in Resources */ = {isa = PBXBuildFile; fileRef = AAB80F801EA303C000CD17FD /* DLWallPaperView.xib */; };
AAC36D0C1E99C9D40058C627 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AAC36D0B1E99C9D40058C627 /* main.m */; };
AAC36D171E99C9D40058C627 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AAC36D161E99C9D40058C627 /* Assets.xcassets */; };
AAC36D1A1E99C9D40058C627 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AAC36D181E99C9D40058C627 /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -50,6 +52,9 @@
/* Begin PBXFileReference section */
1418E187A27745EF47E878B5 /* libPods-DLWeiboProfileController.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DLWeiboProfileController.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A4E57446900B417E14525449 /* Pods-DLWeiboProfileController.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DLWeiboProfileController.release.xcconfig"; path = "Pods/Target Support Files/Pods-DLWeiboProfileController/Pods-DLWeiboProfileController.release.xcconfig"; sourceTree = "<group>"; };
AAB80F7D1EA302D400CD17FD /* DLWallPaperView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLWallPaperView.h; sourceTree = "<group>"; };
AAB80F7E1EA302D400CD17FD /* DLWallPaperView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLWallPaperView.m; sourceTree = "<group>"; };
AAB80F801EA303C000CD17FD /* DLWallPaperView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DLWallPaperView.xib; sourceTree = "<group>"; };
AAC36D071E99C9D40058C627 /* DLWeiboProfileController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DLWeiboProfileController.app; sourceTree = BUILT_PRODUCTS_DIR; };
AAC36D0B1E99C9D40058C627 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
AAC36D161E99C9D40058C627 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -216,6 +221,9 @@
AAC36D4B1E99CBE90058C627 /* DLUserPageNavBar.h */,
AAC36D4C1E99CBE90058C627 /* DLUserPageNavBar.m */,
AAC36D4D1E99CBE90058C627 /* DLUserPageNavBar.xib */,
AAB80F7D1EA302D400CD17FD /* DLWallPaperView.h */,
AAB80F7E1EA302D400CD17FD /* DLWallPaperView.m */,
AAB80F801EA303C000CD17FD /* DLWallPaperView.xib */,
);
path = View;
sourceTree = "<group>";
Expand Down Expand Up @@ -375,6 +383,7 @@
AAC36D501E99CBE90058C627 /* DLUserHeaderView.xib in Resources */,
AAC36D661E99CC870058C627 /* Main.storyboard in Resources */,
AAC36D1A1E99C9D40058C627 /* LaunchScreen.storyboard in Resources */,
AAB80F811EA303C000CD17FD /* DLWallPaperView.xib in Resources */,
AAC36D521E99CBE90058C627 /* DLUserPageNavBar.xib in Resources */,
AAC36D171E99C9D40058C627 /* Assets.xcassets in Resources */,
);
Expand Down Expand Up @@ -452,6 +461,7 @@
AAC36D441E99CB070058C627 /* AppDelegate.m in Sources */,
AAC36D641E99CC0F0058C627 /* PersonalRightViewController.m in Sources */,
AAC36D0C1E99C9D40058C627 /* main.m in Sources */,
AAB80F7F1EA302D400CD17FD /* DLWallPaperView.m in Sources */,
AAC36D4E1E99CBE90058C627 /* ContentViewCell.m in Sources */,
AAC36D611E99CC0F0058C627 /* PersonalCenterTableView.m in Sources */,
AAC36D631E99CC0F0058C627 /* PersonalMiddleViewController.m in Sources */,
Expand Down
Binary file not shown.
Binary file modified DLWeiboProfileController/DLWeiboProfileController/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "wallPaper1.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "wallPaper2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "wallPaper3.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "wallPaper4.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "wallPaper5.jpeg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "wallPaper6.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions DLWeiboProfileController/DLWeiboProfileController/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,53 @@
</objects>
<point key="canvasLocation" x="855" y="-25"/>
</scene>
<!--View Controller-->
<scene sceneID="DXJ-pj-ddP">
<objects>
<viewController id="qS8-fE-lyf" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="CRJ-nJ-CMg"/>
<viewControllerLayoutGuide type="bottom" id="XuH-Qh-zsP"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="3vD-7h-3cr">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4HY-ny-3pi" customClass="DLWallPaperView">
<rect key="frame" x="10" y="56" width="155" height="116"/>
<subviews>
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vOa-c5-EFc" customClass="DLWallPaperView">
<rect key="frame" x="8" y="0.0" width="155" height="116"/>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="vOa-c5-EFc" firstAttribute="top" secondItem="4HY-ny-3pi" secondAttribute="top" id="BB3-zh-eKm"/>
<constraint firstAttribute="trailing" secondItem="vOa-c5-EFc" secondAttribute="trailing" constant="20" id="Ba4-vT-Df7"/>
<constraint firstItem="vOa-c5-EFc" firstAttribute="leading" secondItem="4HY-ny-3pi" secondAttribute="leading" constant="20" id="kl3-sf-Kap"/>
</constraints>
</view>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="E3J-K0-WQe" customClass="DLWallPaperView">
<rect key="frame" x="181" y="56" width="155" height="116"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vqD-nh-73Q" customClass="DLWallPaperView">
<rect key="frame" x="23" y="0.0" width="155" height="116"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
</view>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="5hg-eF-Etw" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1542" y="-56"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="6en-VW-SzP">
<objects>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
//

#import <UIKit/UIKit.h>
@class ContentViewCell;

@protocol ContentViewCellDelegate <NSObject>

-(void)dl_contentViewCellDidRecieveFinishRefreshingNotificaiton:(ContentViewCell *)cell;

@end


@interface ContentViewCell : UITableViewCell

Expand All @@ -17,8 +25,11 @@
@property (nonatomic, assign) BOOL canScroll;
//外部segment点击更改selectIndex,切换页面
@property (assign, nonatomic) NSInteger selectIndex;
@property(nonatomic,weak)id<ContentViewCellDelegate> delegate;

//创建pageViewController
- (void)setPageView;

-(void)dl_refresh;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#import "PersonalRightViewController.h"
#import "BaseTableViewController.h"

@interface ContentViewCell ()<UIPageViewControllerDelegate,UIPageViewControllerDataSource,UIScrollViewDelegate>
@interface ContentViewCell ()<UIPageViewControllerDelegate,UIPageViewControllerDataSource,UIScrollViewDelegate,BaseTableViewControllerDelegate>

@property (strong, nonatomic) NSMutableArray *dataArray;
@property (strong, nonatomic) NSMutableArray<BaseTableViewController *> *dataArray;

@property (strong, nonatomic) UIPageViewController *pageViewCtrl;

Expand All @@ -34,9 +34,17 @@ - (void)dealloc {

}

- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
-(void)dl_refresh
{
[self.dataArray[self.selectIndex] dl_refresh];
}

#pragma mark - BaseTableViewController
-(void)dl_viewControllerDidFinishRefreshing:(BaseTableViewController *)viewController
{
if (self.delegate && [self.delegate respondsToSelector:@selector(dl_contentViewCellDidRecieveFinishRefreshingNotificaiton:)]) {
[self.delegate dl_contentViewCellDidRecieveFinishRefreshingNotificaiton:self];
}
}

///pageView
Expand All @@ -51,8 +59,11 @@ - (void)customPageView {
self.pageViewCtrl.delegate = self;

PersonalLeftViewController *ctrl1 = [[PersonalLeftViewController alloc] init];
ctrl1.delegate = self;
PersonalMiddleViewController *ctrl2 = [[PersonalMiddleViewController alloc] init];
ctrl2.delegate = self;
PersonalRightViewController *ctrl3 = [[PersonalRightViewController alloc] init];
ctrl3.delegate = self;

self.dataArray = @[ctrl1,ctrl2,ctrl3].mutableCopy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="280"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="pc_bg" translatesAutoresizingMaskIntoConstraints="NO" id="7Nq-Pz-OQm">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="wallPaper3" translatesAutoresizingMaskIntoConstraints="NO" id="7Nq-Pz-OQm">
<rect key="frame" x="0.0" y="0.0" width="375" height="280"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</imageView>
Expand Down Expand Up @@ -78,6 +78,6 @@
</view>
</objects>
<resources>
<image name="pc_bg" width="600" height="400"/>
<image name="wallPaper3" width="600" height="810"/>
</resources>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,20 @@ typedef enum : NSUInteger {

@property(nonatomic,assign)CGFloat dl_alpha;


/**
将要刷新
*/
-(void)dl_willRefresh;

/**
刷新
*/
-(void)dl_refresh;

/**
结束刷新
*/
-(void)dl_endRefresh;

@end
Loading

0 comments on commit 70f0996

Please sign in to comment.