Skip to content

Commit

Permalink
修改presen到另一个界面返回时候界面下部分延迟异常的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ChavezChen committed Jan 8, 2018
1 parent 9f6d2ca commit a036690
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
Binary file modified .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions ViewControllerTransition.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
6661884E1FDEC7DE0038D644 /* CWLateralSlideAnimator.m in Sources */ = {isa = PBXBuildFile; fileRef = 666188481FDEC7DE0038D644 /* CWLateralSlideAnimator.m */; };
6661884F1FDEC7DE0038D644 /* CWDrawerTransition.m in Sources */ = {isa = PBXBuildFile; fileRef = 666188491FDEC7DE0038D644 /* CWDrawerTransition.m */; };
666188501FDEC7DE0038D644 /* CWLateralSlideConfiguration.m in Sources */ = {isa = PBXBuildFile; fileRef = 6661884B1FDEC7DE0038D644 /* CWLateralSlideConfiguration.m */; };
666188DC2003ACFA0038D644 /* 2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 666188DB2003ACFA0038D644 /* 2.jpg */; };
669409DA1F10B4B10095D997 /* 1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 669409D91F10B4B10095D997 /* 1.jpg */; };
669409E01F10BA240095D997 /* NextTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 669409DE1F10BA240095D997 /* NextTableViewCell.m */; };
669409E11F10BA240095D997 /* NextTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 669409DF1F10BA240095D997 /* NextTableViewCell.xib */; };
Expand Down Expand Up @@ -59,6 +60,7 @@
666188491FDEC7DE0038D644 /* CWDrawerTransition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CWDrawerTransition.m; sourceTree = "<group>"; };
6661884A1FDEC7DE0038D644 /* UIViewController+CWLateralSlide.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+CWLateralSlide.h"; sourceTree = "<group>"; };
6661884B1FDEC7DE0038D644 /* CWLateralSlideConfiguration.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CWLateralSlideConfiguration.m; sourceTree = "<group>"; };
666188DB2003ACFA0038D644 /* 2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 2.jpg; sourceTree = "<group>"; };
669409D91F10B4B10095D997 /* 1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = 1.jpg; sourceTree = "<group>"; };
669409DD1F10BA240095D997 /* NextTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NextTableViewCell.h; sourceTree = "<group>"; };
669409DE1F10BA240095D997 /* NextTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NextTableViewCell.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -86,6 +88,7 @@
children = (
669409E81F13B9640095D997 /* 0.jpg */,
669409D91F10B4B10095D997 /* 1.jpg */,
666188DB2003ACFA0038D644 /* 2.jpg */,
1A8F224A1F04CD3E00322D76 /* NavigationController.h */,
1A8F224B1F04CD3E00322D76 /* NavigationController.m */,
1A8F224E1F04CD3E00322D76 /* TabbarController.h */,
Expand Down Expand Up @@ -225,6 +228,7 @@
files = (
669409DA1F10B4B10095D997 /* 1.jpg in Resources */,
1AB2C1F61F022F9E003F5EE0 /* LaunchScreen.storyboard in Resources */,
666188DC2003ACFA0038D644 /* 2.jpg in Resources */,
669409E11F10BA240095D997 /* NextTableViewCell.xib in Resources */,
1AB2C1F31F022F9E003F5EE0 /* Assets.xcassets in Resources */,
669409E91F13B9640095D997 /* 0.jpg in Resources */,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "ViewControllerTransition/Clasess/NextViewController.m"
timestampString = "536167933.441574"
timestampString = "537111907.522616"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "86"
endingLineNumber = "86"
startingLineNumber = "87"
endingLineNumber = "87"
landmarkName = "-tableView:numberOfRowsInSection:"
landmarkType = "7">
</BreakpointContent>
Expand Down
Binary file added ViewControllerTransition/Clasess/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion ViewControllerTransition/Clasess/LeftViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#import "NextTableViewCell.h"

#import "NextViewController.h"

@interface LeftViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic,weak) UITableView *tableView;
Expand Down Expand Up @@ -133,6 +132,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

if (indexPath.row == 0 && _drawerType != DrawerDefaultRight && _drawerType != DrawerTypeMaskRight) {
[self presentViewController:vc animated:YES completion:nil];
// [self presentViewController:[TestViewController new] animated:YES completion:nil];

}else {
[self cw_pushViewController:vc];
}
Expand Down
15 changes: 8 additions & 7 deletions ViewControllerTransition/Clasess/NextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ - (instancetype)init

- (void)viewDidLoad {
[super viewDidLoad];

[self setupHeader];
self.view.backgroundColor = [UIColor whiteColor];

[self setupTableView];

}

- (void)setupTableView {
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 300, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds)-300) style:UITableViewStylePlain];
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds)) style:UITableViewStylePlain];
tableView.delegate = self;
tableView.dataSource = self;
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
Expand All @@ -65,14 +63,17 @@ - (void)setupTableView {
_tableView = tableView;

[tableView registerNib:[UINib nibWithNibName:@"NextTableViewCell" bundle:nil] forCellReuseIdentifier:@"NextCell"];

[self setupHeader];
}

- (void)setupHeader {
UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), 300)];
imageV.backgroundColor = [UIColor clearColor];
imageV.contentMode = UIViewContentModeScaleAspectFill;
imageV.image = [UIImage imageNamed:@"0.jpg"];
[self.view addSubview:imageV];
imageV.contentMode = UIViewContentModeBottom;
imageV.image = [UIImage imageNamed:@"2.jpg"];

_tableView.tableHeaderView = imageV;
}


Expand Down
6 changes: 2 additions & 4 deletions ViewControllerTransition/Clasess/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#import "ViewController.h"
#import "LeftViewController.h"
#import "RightViewController.h"

#import "CWScrollView.h"

#import "UIViewController+CWLateralSlide.h"


Expand Down Expand Up @@ -57,10 +55,10 @@ - (void)viewDidLoad {
- (void)leftClick {
// 自己随心所欲创建的一个控制器
LeftViewController *vc = [[LeftViewController alloc] init];

// 这个代码与框架无关,与demo相关,因为有兄弟在侧滑出来的界面,使用present到另一个界面返回的时候会有异常,这里提供各个场景的解决方式,需要在侧滑的界面present的同学可以借鉴一下!处理方式在leftViewController的viewDidAppear:方法内
vc.drawerType = DrawerDefaultLeft;

// 调用这个方法
[self cw_showDrawerViewController:vc animationType:CWDrawerAnimationTypeDefault configuration:nil];

Expand Down

0 comments on commit a036690

Please sign in to comment.