jikaipeng 5 years ago
parent
commit
cd96931182

+ 4 - 4
KuDianProject.xcodeproj/project.pbxproj

1596
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1596
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1597
 				CODE_SIGN_ENTITLEMENTS = KuDianProject/KuDianProject.entitlements;
1597
 				CODE_SIGN_ENTITLEMENTS = KuDianProject/KuDianProject.entitlements;
1598
 				CODE_SIGN_IDENTITY = "iPhone Developer";
1598
 				CODE_SIGN_IDENTITY = "iPhone Developer";
1599
-				CODE_SIGN_STYLE = Manual;
1599
+				CODE_SIGN_STYLE = Automatic;
1600
 				DEVELOPMENT_TEAM = WV23VEMQV8;
1600
 				DEVELOPMENT_TEAM = WV23VEMQV8;
1601
 				ENABLE_BITCODE = NO;
1601
 				ENABLE_BITCODE = NO;
1602
 				FRAMEWORK_SEARCH_PATHS = (
1602
 				FRAMEWORK_SEARCH_PATHS = (
1679
 				);
1679
 				);
1680
 				PRODUCT_BUNDLE_IDENTIFIER = com.KuDianProject.eight;
1680
 				PRODUCT_BUNDLE_IDENTIFIER = com.KuDianProject.eight;
1681
 				PRODUCT_NAME = "$(TARGET_NAME)";
1681
 				PRODUCT_NAME = "$(TARGET_NAME)";
1682
-				PROVISIONING_PROFILE_SPECIFIER = dev;
1682
+				PROVISIONING_PROFILE_SPECIFIER = "";
1683
 				TARGETED_DEVICE_FAMILY = 1;
1683
 				TARGETED_DEVICE_FAMILY = 1;
1684
 			};
1684
 			};
1685
 			name = Debug;
1685
 			name = Debug;
1692
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1692
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1693
 				CODE_SIGN_ENTITLEMENTS = KuDianProject/KuDianProject.entitlements;
1693
 				CODE_SIGN_ENTITLEMENTS = KuDianProject/KuDianProject.entitlements;
1694
 				CODE_SIGN_IDENTITY = "iPhone Developer";
1694
 				CODE_SIGN_IDENTITY = "iPhone Developer";
1695
-				CODE_SIGN_STYLE = Manual;
1695
+				CODE_SIGN_STYLE = Automatic;
1696
 				DEVELOPMENT_TEAM = WV23VEMQV8;
1696
 				DEVELOPMENT_TEAM = WV23VEMQV8;
1697
 				ENABLE_BITCODE = NO;
1697
 				ENABLE_BITCODE = NO;
1698
 				FRAMEWORK_SEARCH_PATHS = (
1698
 				FRAMEWORK_SEARCH_PATHS = (
1775
 				);
1775
 				);
1776
 				PRODUCT_BUNDLE_IDENTIFIER = com.KuDianProject.eight;
1776
 				PRODUCT_BUNDLE_IDENTIFIER = com.KuDianProject.eight;
1777
 				PRODUCT_NAME = "$(TARGET_NAME)";
1777
 				PRODUCT_NAME = "$(TARGET_NAME)";
1778
-				PROVISIONING_PROFILE_SPECIFIER = dev;
1778
+				PROVISIONING_PROFILE_SPECIFIER = "";
1779
 				TARGETED_DEVICE_FAMILY = 1;
1779
 				TARGETED_DEVICE_FAMILY = 1;
1780
 			};
1780
 			};
1781
 			name = Release;
1781
 			name = Release;

BIN
KuDianProject.xcworkspace/xcuserdata/kaipeng.xcuserdatad/UserInterfaceState.xcuserstate


+ 57 - 1
KuDianProject/Public/KDPNetworkRequestHTTP.m

9
 #import "KDPNetworkRequestHTTP.h"
9
 #import "KDPNetworkRequestHTTP.h"
10
 #import <AdSupport/AdSupport.h>
10
 #import <AdSupport/AdSupport.h>
11
 #import "KDPPhoneLoginViewController.h"
11
 #import "KDPPhoneLoginViewController.h"
12
+#import "KDPTabBarVC.h"
12
 @implementation KDPNetworkRequestHTTP
13
 @implementation KDPNetworkRequestHTTP
13
 + (void)postURL:(NSString *)url params:(NSDictionary *)params success:(void(^)(id json))success failure:(void(^)(NSError *error))failure
14
 + (void)postURL:(NSString *)url params:(NSDictionary *)params success:(void(^)(id json))success failure:(void(^)(NSError *error))failure
14
 {
15
 {
84
 {
85
 {
85
     [[NSNotificationCenter defaultCenter]postNotificationName:@"exitLogin" object:nil];
86
     [[NSNotificationCenter defaultCenter]postNotificationName:@"exitLogin" object:nil];
86
     [KDPAccountTool deleteAccount];
87
     [KDPAccountTool deleteAccount];
88
+
89
+    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:[[UINavigationController alloc]initWithRootViewController:[[KDPPhoneLoginViewController alloc]init]] animated:YES completion:^{
90
+        UIViewController *currentVC = [[self alloc] getCurrentVC];
91
+        
92
+        [currentVC.navigationController popToRootViewControllerAnimated:YES];
93
+        
94
+        KDPTabBarVC *tabbar = (KDPTabBarVC *)[UIApplication sharedApplication].keyWindow.rootViewController;
95
+        tabbar.selectedIndex = 0;
96
+    }];
87
     
97
     
88
-    [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:[[UINavigationController alloc]initWithRootViewController:[[KDPPhoneLoginViewController alloc]init]] animated:YES completion:nil];
98
+}
99
+
100
+- (UIViewController *)getCurrentVC {
101
+    // Find best view controller
102
+    UIViewController* viewController = [UIApplication sharedApplication].keyWindow.rootViewController;
103
+    return [self findBestViewController:viewController];
104
+}
105
+
106
+-(UIViewController*) findBestViewController:(UIViewController*)vc {
89
     
107
     
108
+    if (vc.presentedViewController) {
109
+        
110
+        // Return presented view controller
111
+        return [self findBestViewController:vc.presentedViewController];
112
+        
113
+    } else if ([vc isKindOfClass:[UISplitViewController class]]) {
114
+        
115
+        // Return right hand side
116
+        UISplitViewController* svc = (UISplitViewController*) vc;
117
+        if (svc.viewControllers.count > 0)
118
+            return [self findBestViewController:svc.viewControllers.lastObject];
119
+        else
120
+            return vc;
121
+        
122
+    } else if ([vc isKindOfClass:[UINavigationController class]]) {
123
+        
124
+        // Return top view
125
+        UINavigationController* svc = (UINavigationController*) vc;
126
+        if (svc.viewControllers.count > 0)
127
+            return [self findBestViewController:svc.topViewController];
128
+        else
129
+            return vc;
130
+        
131
+    } else if ([vc isKindOfClass:[UITabBarController class]]) {
132
+        
133
+        // Return visible view
134
+        UITabBarController* svc = (UITabBarController*) vc;
135
+        if (svc.viewControllers.count > 0)
136
+            return [self findBestViewController:svc.selectedViewController];
137
+        else
138
+            return vc;
139
+        
140
+    } else {
141
+        
142
+        // Unknown view controller type, return last child view controller
143
+        return vc;
144
+        
145
+    }
90
 }
146
 }
91
 
147
 
92
 /**
148
 /**