Commit 781efd64 authored by 汪洋's avatar 汪洋

shareView 细分cancleShareView和finishShareView

parent 1cebc892
......@@ -47,10 +47,11 @@
/** 分享视频 */
- (void)shareVideo:(GMSharePlatform)shareType;
/** 取消分享 */
/// 点击背景、点击取消隐藏 shareView时,会走这个回调
- (void)cancleShareView;
- (void)shareViewDidClose;
/// 点击某个渠道,进而隐藏 shareView 时,会走这个回调
- (void)finishShareView;
@end
......
......@@ -125,7 +125,7 @@ static NSString *shareCellIdentifier = @"shareCellIdentifier";
_topLineView.backgroundColor = UIColor.separatorLine;
[_bgView addSubview:_topLineView];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideShareView)];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeButtonClicked:)];
tap.delegate = self;
[self addGestureRecognizer:tap];
......@@ -520,18 +520,6 @@ static NSString *shareCellIdentifier = @"shareCellIdentifier";
}];
}
- (void)hideShareView{
[UIView animateWithDuration:0.25 animations:^{
_bgView.top = MAINSCREEN_HEIGHT;
self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0];
} completion:^(BOOL finished) {
[self removeFromSuperview];
if ([self.delegate respondsToSelector:@selector(shareViewDidClose)]) {
[self.delegate shareViewDidClose];
}
}];
}
#pragma mark - 埋点
// 弹出分享框埋点
- (void)phobosClickShare {
......@@ -634,7 +622,24 @@ static NSString *shareCellIdentifier = @"shareCellIdentifier";
if ([self.delegate respondsToSelector:@selector(cancleShareView)]) {
[self.delegate cancleShareView];
}
[self hideShareView];
[self performHideAnimation];
}
- (void)hideShareView {
if ([self.delegate respondsToSelector:@selector(finishShareView)]) {
[self.delegate finishShareView];
}
[self performHideAnimation];
}
- (void)performHideAnimation {
[UIView animateWithDuration:0.25 animations:^{
_bgView.top = MAINSCREEN_HEIGHT;
self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0];
} completion:^(BOOL finished) {
[self removeFromSuperview];
}];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment