This commit is contained in:
启星
2025-11-28 22:43:06 +08:00
parent 8913ea6f48
commit 7eb4f8d3b8
197 changed files with 7315 additions and 666 deletions

View File

@@ -148,11 +148,24 @@
showToast(@"请选择PK时长");
return;
}
MJWeakSelf
__weak typeof(self) weakSelf = self;
[QXMineNetwork roomPkStartWithPk_id:self.pkId pk_times:self.timeModel.relation_id successBlock:^(NSDictionary * _Nonnull dict) {
[weakSelf hide];
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) {
NSLog(@"⚠️ self has been deallocated, skipping hide operation");
return;
}
dispatch_async(dispatch_get_main_queue(), ^{
__strong typeof(weakSelf) strongSelf = weakSelf;
if (strongSelf) {
[strongSelf hide];
}
});
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
// 线
dispatch_async(dispatch_get_main_queue(), ^{
showToast(msg);
});
}];
}
@@ -220,10 +233,21 @@
}];
}
-(void)hide{
if (!self.superview) {
NSLog(@"⚠️ View already removed from superview");
return;
}
[UIView animateWithDuration:0.3 animations:^{
self.bgView.y = SCREEN_HEIGHT;
if (self.bgView) {
self.bgView.y = SCREEN_HEIGHT;
}
} completion:^(BOOL finished) {
[self removeFromSuperview];
//
if (self.superview) {
[self removeFromSuperview];
}
// dealloc 访
// completion block 访
}];
}
@end