2
0

AppDelegate.mm 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // AppDelegate.m
  3. // SLAiELTS
  4. //
  5. // Created by Gusont on 2023/2/27.
  6. //
  7. #import "AppDelegate.h"
  8. #import "IQKeyboardManager.h"
  9. #import "SLLoginVCViewController.h"
  10. #import "SLBaseTabBarController.h"
  11. @interface AppDelegate ()
  12. @end
  13. @implementation AppDelegate
  14. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  15. // Override point for customization after application launch.
  16. self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  17. self.window.backgroundColor = [UIColor whiteColor];
  18. [SLHttpCenter SharedInstance].serverUrl = @"http://dlchat.zheke.com";
  19. // [SLHttpCenter SharedInstance].serverUrl = @"http://10.0.0.14:8088";
  20. // SLBaseTabBarController *baseVc = [[SLBaseTabBarController alloc] init];
  21. UIViewController *vc = [SLLoginVCViewController loadViewControllewWithNib];
  22. self.window.rootViewController = [[SLBaseNavigationController alloc] initWithRootViewController:vc];
  23. [self.window makeKeyAndVisible];
  24. [self buildIQkeyBoard];
  25. return YES;
  26. }
  27. - (void)setTabWithRootWindow {
  28. SLBaseTabBarController *tabBarContr = [[SLBaseTabBarController alloc] init];
  29. self.window.rootViewController = [[SLBaseNavigationController alloc] initWithRootViewController:tabBarContr];;
  30. [self.window makeKeyAndVisible];
  31. }
  32. - (void)setLoginVcWithRootWindow {
  33. UIViewController *vc = [SLLoginVCViewController loadViewControllewWithNib];
  34. self.window.rootViewController = [[SLBaseNavigationController alloc] initWithRootViewController:vc];;
  35. [self.window makeKeyAndVisible];
  36. }
  37. #pragma MARK- IQ键盘初始化
  38. -(void)buildIQkeyBoard
  39. {
  40. IQKeyboardManager *manager = [IQKeyboardManager sharedManager];
  41. manager.enable = YES;//是否启用键盘管理
  42. manager.shouldResignOnTouchOutside = YES;//点击可编辑之外,是否自动隐藏键盘
  43. manager.enableAutoToolbar = NO;//控制是否显示键盘上的工具条
  44. manager.keyboardDistanceFromTextField = 20.f;
  45. manager.layoutIfNeededOnUpdate = YES;
  46. }
  47. @end