|
@@ -59,34 +59,26 @@
|
|
[self.imageUpload addPicWithPhotoLibrary];
|
|
[self.imageUpload addPicWithPhotoLibrary];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
|
|
|
|
- if (cell.accessoryType == UITableViewCellAccessoryCheckmark) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- for (UITableViewCell *acell in tableView.visibleCells) {
|
|
|
|
- acell.accessoryType = acell == cell ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
|
|
|
- }
|
|
|
|
- if (indexPath.row == 0) {
|
|
|
|
- [DAConfig setUserLanguage:@"zh-Hans"];
|
|
|
|
- } else if (indexPath.row == 1) {
|
|
|
|
- [DAConfig setUserLanguage:@"en"];
|
|
|
|
- } else {
|
|
|
|
- [DAConfig setUserLanguage:nil];
|
|
|
|
-
|
|
|
|
|
|
+ SLPageModelDetail *detail = [[self.dataModels objectAtIndex:indexPath.section] objectAtIndex:indexPath.row];
|
|
|
|
+ if ([detail.title isEqualToString:@"简体中文"] || [detail.title isEqualToString:@"English"]) {
|
|
|
|
+ UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
|
|
|
|
+ if (cell.accessoryType == UITableViewCellAccessoryCheckmark) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ for (UITableViewCell *acell in tableView.visibleCells) {
|
|
|
|
+ acell.accessoryType = acell == cell ? UITableViewCellAccessoryCheckmark : UITableViewCellAccessoryNone;
|
|
|
|
+ }
|
|
|
|
+ if (indexPath.row == 0) {
|
|
|
|
+ [DAConfig setUserLanguage:@"zh-Hans"];
|
|
|
|
+ } else if (indexPath.row == 1) {
|
|
|
|
+ [DAConfig setUserLanguage:@"en"];
|
|
|
|
+ } else {
|
|
|
|
+ [DAConfig setUserLanguage:nil];
|
|
|
|
+ }
|
|
|
|
+ //更新当前
|
|
|
|
+ AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
+ [appDelegate setTabWithRootWindow];
|
|
}
|
|
}
|
|
- //更新当前storyboard
|
|
|
|
-// UITabBarController *tbc = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateInitialViewController];
|
|
|
|
-// tbc.selectedIndex = 2;
|
|
|
|
-// DALanguageSettingsViewController *vc = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:NSStringFromClass([DALanguageSettingsViewController class])];
|
|
|
|
-// UINavigationController *nvc = tbc.selectedViewController;
|
|
|
|
-// NSMutableArray *vcs = nvc.viewControllers.mutableCopy;
|
|
|
|
-// [vcs addObject:vc];
|
|
|
|
- //解决奇怪的动画bug。异步执行
|
|
|
|
-// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
-// [UIApplication sharedApplication].keyWindow.rootViewController = tbc;
|
|
|
|
-// nvc.viewControllers = vcs;
|
|
|
|
-// NSLog(@"已切换到语言 %@", [NSBundle currentLanguage]);
|
|
|
|
-// });
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|