@@ -18,6 +18,7 @@ @interface TopicListView ()
1818}
1919
2020@property (nonatomic , copy ) TopicListViewBlock block;
21+ @property (nonatomic , copy ) TopicListViewHideBlock hideBlock;
2122
2223@end
2324
@@ -28,11 +29,13 @@ - (id)initWithFrame:(CGRect)frame
2829 numbers : (NSArray *)numbers
2930 defaultIndex : (NSInteger )index
3031 selectedBlock : (TopicListViewBlock)selectedHandle
32+ hideBlock : (TopicListViewHideBlock)hideHandle
3133{
3234 self = [super initWithFrame: frame];
3335 if (self) {
3436 self.backgroundColor = [UIColor colorWithRed: 0 green: 0 blue: 0 alpha: 0.4 ];
3537 self.block = selectedHandle;
38+ self.hideBlock = hideHandle;
3639 self.clipsToBounds = YES ;
3740
3841 _baseBtn = [[UIButton alloc ] initWithFrame: CGRectMake (0 , 0 , kScreen_Width , self .frame.size.height)];
@@ -80,9 +83,11 @@ - (void)changeWithTitles:(NSArray *)titles
8083 numbers : (NSArray *)numbers
8184 defaultIndex : (NSInteger )index
8285 selectedBlock : (TopicListViewBlock)selectedHandle
86+ hideBlock : (TopicListViewHideBlock)hideHandle
8387{
8488 self.block = selectedHandle;
85-
89+ self.hideBlock = hideHandle;
90+
8691 CGRect frame = _baseView.frame ;
8792 frame.origin .y = -frame.size .height ;
8893 [UIView animateWithDuration: 0.2 delay: 0.0 options: UIViewAnimationOptionCurveLinear animations: ^{
@@ -144,7 +149,10 @@ - (void)hideBtnView
144149 [UIView animateWithDuration: 0.3 delay: 0.0 options: UIViewAnimationOptionCurveLinear animations: ^{
145150 _baseView.frame = frame;
146151 } completion: ^(BOOL finished) {
147- [UIView animateWithDuration: 0.1 animations: ^{
152+ if (self.hideBlock ) {
153+ self.hideBlock ();
154+ }
155+ [UIView animateWithDuration: 0.2 animations: ^{
148156 self.alpha = 0 ;
149157 } completion: ^(BOOL finished) {
150158 [self removeFromSuperview ];
0 commit comments