Vkontakte-iOS-SDK
Vkontakte-iOS-SDK copied to clipboard
Blocked Controls in Authorization View
When clicked on other links, except login or cancel, in authorization form - controls blocked by activity indicator.
You can change container view for your _hud to _webView, so cancel button will be acceptable for user. I use this method:
- (void)webViewDidStartLoad:(UIWebView *)webView { [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; _hud = [[MBProgressHUD alloc] initWithView:_webView]; [_webView addSubview:_hud]; _hud.dimBackground = YES; _hud.delegate = self; [_hud show:YES]; } I know, that this code doesn't solve the problem, but it makes this situation avoidable for user.
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
NSURL *URL = [request URL]; if ([[URL absoluteString] isEqualToString:@"http://api.vk.com/blank.html#error=access_denied&error_reason=user_denied&error_description=User%20denied%20your%20request"]) { if (self.delegate && [self.delegate respondsToSelector:@selector(authorizationDidCanceled)]) { [self.delegate authorizationDidCanceled]; } return NO; } NSString *const vkPagePrefix = @"http://vk.com"; NSString *const vkPageMobilePrefix = @"http://m.vk.com"; NSString *const vkPageMobileSettingsPrefix = @"http://m.vk.com/settings?act=change_regional&"; NSString *const iTunesPagePrefix = @"http://itunes.apple.com"; if ([[URL absoluteString] length] >= [vkPagePrefix length] && [[[URL absoluteString] substringWithRange: NSMakeRange(0, [vkPagePrefix length])] isEqualToString:vkPagePrefix]) return NO; if ([[URL absoluteString] length] >= [vkPageMobilePrefix length] && [[[URL absoluteString] substringWithRange: NSMakeRange(0, [vkPageMobilePrefix length])] isEqualToString:vkPageMobilePrefix]) { if ([[URL absoluteString] length] >= [vkPageMobileSettingsPrefix length] && [[[URL absoluteString] substringWithRange: NSMakeRange(0, [vkPageMobileSettingsPrefix length])] isEqualToString:vkPageMobileSettingsPrefix]) return YES; return NO; } if ([[[URL absoluteString] substringWithRange: NSMakeRange(0, [iTunesPagePrefix length])] isEqualToString:iTunesPagePrefix]) return NO; NSLog(@"Request: %@", [URL absoluteString]); return YES; }
Now user can only change language from suggested by default and click "Login" or "Cancel". All settings page, mobile and full version of site, itunes and app page are blocked.