Skip to content

Commit

Permalink
iOS8闪动问题修复
Browse files Browse the repository at this point in the history
  • Loading branch information
ChavezChen committed Apr 27, 2018
1 parent ce5985d commit 4cdfc1f
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 18 deletions.
Binary file modified .DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions CWLateralSlide.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Pod::Spec.new do |s|
#

s.name = "CWLateralSlide"
s.version = "1.5.9"
s.summary = "侧滑框架."
s.version = "1.6.0"
s.summary = "侧滑抽屉框架."

s.description = "一行代码集成侧滑功能."
s.description = "一行代码集成侧滑抽屉功能."


s.homepage = "https://github.com/ChavezChen/CWLateralSlide"
Expand Down Expand Up @@ -74,7 +74,7 @@ Pod::Spec.new do |s|
# Supports git, hg, bzr, svn and HTTP.
#

s.source = { :git => "https://github.com/ChavezChen/CWLateralSlide.git", :tag => "1.5.9" }
s.source = { :git => "https://github.com/ChavezChen/CWLateralSlide.git", :tag => "1.6.0" }


# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand Down
2 changes: 1 addition & 1 deletion CWLateralSlide/CWDrawerTransition.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (void)animationViewHidden:(id <UIViewControllerContextTransitioning>)transitio
if ([containerView.subviews.firstObject isKindOfClass:[UIImageView class]])
backImageView = containerView.subviews.firstObject;

[UIView animateKeyframesWithDuration:[self transitionDuration:transitionContext] delay:_hiddenDelayTime options:UIViewKeyframeAnimationOptionCalculationModeCubic animations:^{
[UIView animateKeyframesWithDuration:[self transitionDuration:transitionContext] delay:_hiddenDelayTime options:UIViewKeyframeAnimationOptionCalculationModeLinear animations:^{

[UIView addKeyframeWithRelativeStartTime:0 relativeDuration:1.0 animations:^{
toVC.view.transform = CGAffineTransformIdentity;
Expand Down
8 changes: 4 additions & 4 deletions CWLateralSlide/CWInteractiveTransition.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ - (void)stopDisplayerLink {
}

- (void)cw_update {
if (_percent >= 1 && _toFinish) {
if (_percent >= 0.97 && _toFinish) {
[self stopDisplayerLink];
[self finishInteractiveTransition];
}else if (_percent <= 0 && !_toFinish) {
}else if (_percent <= 0.03 && !_toFinish) {
[self stopDisplayerLink];
[self cancelInteractiveTransition];
}else {
Expand All @@ -186,8 +186,8 @@ - (void)cw_update {
}else {
_percent -= _oncePercent;
}
_percent = fminf(fmaxf(_percent, 0.0), 1.0);
[self updateInteractiveTransition:_percent];
CGFloat percent = fminf(fmaxf(_percent, 0.03), 0.97);
[self updateInteractiveTransition:percent];
}
}

Expand Down
5 changes: 4 additions & 1 deletion CWLateralSlide/CWLateralSlideConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ - (instancetype)initWithDistance:(float)distance maskAlpha:(float)alpha scaleY:(
_direction = direction;
_backImage = backImage;
_scaleY = scaleY;
_finishPercent = 0.4;
_showAnimDuration = 0.25;
_HiddenAnimDuration = 0.25;
}
return self;
}
Expand Down Expand Up @@ -49,7 +52,7 @@ - (float)scaleY {

- (float)finishPercent {
if (_finishPercent <= 0)
return 0.5;
return 0.4;
return _finishPercent;
}

Expand Down
6 changes: 3 additions & 3 deletions CWLateralSlide/UIViewController+CWLateralSlide.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

@interface UIViewController (CWLateralSlide)

/*-----------------------------------v1.5.9-----------------------------------------*/
/*-----------------------------------v1.5.9-----------------------------------------*/
/*-----------------------------------v1.5.9-----------------------------------------*/
/*-----------------------------------v1.6.0-----------------------------------------*/
/*-----------------------------------v1.6.0-----------------------------------------*/
/*-----------------------------------v1.6.0-----------------------------------------*/

/**
显示默认抽屉
Expand Down
4 changes: 2 additions & 2 deletions CWLateralSlideDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
DEVELOPMENT_TEAM = ML49CE4G8Y;
INFOPLIST_FILE = "$(SRCROOT)/CWLateralSlideDemo/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.Chavez.CWLateralSlide;
PRODUCT_BUNDLE_IDENTIFIER = com.Chavez.CWLateralSlide11;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -410,7 +410,7 @@
DEVELOPMENT_TEAM = ML49CE4G8Y;
INFOPLIST_FILE = "$(SRCROOT)/CWLateralSlideDemo/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.Chavez.CWLateralSlide;
PRODUCT_BUNDLE_IDENTIFIER = com.Chavez.CWLateralSlide11;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions CWLateralSlideDemo/Clasess/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ - (void)leftClick {
// 自己随心所欲创建的一个控制器
LeftViewController *vc = [[LeftViewController alloc] init];

// 这个代码与框架无关,与demo相关,因为有兄弟在侧滑出来的界面,使用present到另一个界面返回的时候会有异常,这里提供各个场景的解决方式,需要在侧滑的界面present的同学可以借鉴一下!处理方式在leftViewController的viewDidAppear:方法内
// 这个代码与框架无关,与demo相关,因为有兄弟在侧滑出来的界面,使用present到另一个界面返回的时候会有异常,这里提供各个场景的解决方式,需要在侧滑的界面present的同学可以借鉴一下!处理方式在leftViewController的viewDidAppear:方法内,或者直接用cw_presentViewController
// 另外一种方式 直接使用 cw_presentViewController:方法也可以,两个方法的表示形式有点差异
vc.drawerType = DrawerDefaultLeft; // 为了表示各种场景才加上这个判断,如果只有单一场景这行代码完全不需要

Expand Down Expand Up @@ -114,7 +114,7 @@ - (void)drawerMaskAnimationLeft{

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

// 调用这个方法
[self cw_showDrawerViewController:vc animationType:CWDrawerAnimationTypeMask configuration:nil];
}
Expand Down
2 changes: 1 addition & 1 deletion CWLateralSlideDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.5.9</string>
<string>1.6.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
Expand Down

0 comments on commit 4cdfc1f

Please sign in to comment.