提交 40e0b34f 编写于 作者: Y yixiang

解决toast某些情况无法展示的问题

上级 5be5390b
......@@ -13,8 +13,6 @@ typedef void (^DoraemonHandleRestartCancleActionBlock)(void);
@interface DoraemonToastUtil : NSObject
+ (void)showToast:(NSString *)text;
+ (void)showToast:(NSString *)text inView:(UIView *)superView;
+ (void)handleRestartActionWithVC:(UIViewController *)vc
......
......@@ -15,10 +15,6 @@
@implementation DoraemonToastUtil
+ (void)showToast:(NSString *)text{
[DoraemonToastUtil showToast:text inView:[UIApplication sharedApplication].keyWindow];
}
+ (void)showToast:(NSString *)text inView:(UIView *)superView {
if (!superView) {
return;
......
......@@ -54,7 +54,7 @@
- (void)jump{
if (_h5UrlTextView.text.length==0) {
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"h5链接不能为空")];
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"h5链接不能为空") inView:self.view];
return;
}
NSString *h5Url = _h5UrlTextView.text;
......
......@@ -71,7 +71,7 @@
[self presentViewController:myQlPreViewController animated:YES completion:nil];
}
}else{
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"文件不存在")];
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"文件不存在") inView:self.view];
}
}
......
......@@ -103,7 +103,7 @@
#pragma mark - DoraemonMockGPSInputViewDelegate
- (void)inputViewOkClick:(NSString *)gps{
if (![[DoraemonCacheManager sharedInstance] mockGPSSwitch]) {
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"mock开关没有打开")];
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"mock开关没有打开") inView:self.view];
return;
}
NSArray *array = [gps componentsSeparatedByString:@" "];
......@@ -111,18 +111,18 @@
NSString *longitudeValue = array[0];
NSString *latitudeValue = array[1];
if (longitudeValue.length==0 || latitudeValue.length==0) {
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"经纬度不能为空")];
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"经纬度不能为空") inView:self.view];
return;
}
CGFloat longitude = [longitudeValue floatValue];
CGFloat latitude = [latitudeValue floatValue];
if (longitude < -180 || longitude > 180) {
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"经度不合法")];
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"经度不合法") inView:self.view];
return;
}
if (latitude < -90 || latitude > 90){
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"纬度不合法")];
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"纬度不合法") inView:self.view];
return;
}
......@@ -137,7 +137,7 @@
CLLocation *loc = [[CLLocation alloc] initWithLatitude:coordinate.latitude longitude:coordinate.longitude];
[[DoraemonGPSMocker shareInstance] mockPoint:loc];
}else{
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"格式不正确")];
[DoraemonToastUtil showToast:DoraemonLocalizedString(@"格式不正确") inView:self.view];
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册