mirror of
https://github.com/wu736139669/Ash_AWord.git
synced 2026-08-05 05:55:19 +00:00
new
This commit is contained in:
+9
-9
@@ -10,11 +10,11 @@
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Ash_AWord/AppDelegate.m"
|
||||
timestampString = "449487315.158869"
|
||||
timestampString = "449628804.640986"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "80"
|
||||
endingLineNumber = "80"
|
||||
startingLineNumber = "94"
|
||||
endingLineNumber = "94"
|
||||
landmarkName = "-setUmeng"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
@@ -58,11 +58,11 @@
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Ash_AWord/ViewControllers/Login/LoginViewController.m"
|
||||
timestampString = "449549149.00937"
|
||||
timestampString = "449628804.640986"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "78"
|
||||
endingLineNumber = "78"
|
||||
startingLineNumber = "79"
|
||||
endingLineNumber = "79"
|
||||
landmarkName = "-weixinLoginBtnClick:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
@@ -74,11 +74,11 @@
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
filePath = "Ash_AWord/ViewControllers/Login/LoginViewController.m"
|
||||
timestampString = "449549149.00937"
|
||||
timestampString = "449628804.640986"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "80"
|
||||
endingLineNumber = "80"
|
||||
startingLineNumber = "81"
|
||||
endingLineNumber = "81"
|
||||
landmarkName = "-weixinLoginBtnClick:"
|
||||
landmarkType = "5">
|
||||
</BreakpointContent>
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
@property (strong, nonatomic) MainViewController* mainViewController;
|
||||
|
||||
/**
|
||||
* 当前可视viewController
|
||||
*/
|
||||
+ (UIViewController *)visibleViewController;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -71,6 +71,20 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前可视viewController
|
||||
*/
|
||||
+ (UIViewController *)visibleViewController
|
||||
{
|
||||
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
UITabBarController *tab = (UITabBarController *)delegate.window.rootViewController;
|
||||
if ([tab isKindOfClass:[UITabBarController class]])
|
||||
{
|
||||
return ([(UINavigationController *)[[tab viewControllers] objectAtIndex:tab.selectedIndex] visibleViewController]);
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark methods
|
||||
-(void)setUmeng
|
||||
{
|
||||
|
||||
@@ -213,10 +213,10 @@
|
||||
[btn setImage:highlightedImage forState:UIControlStateHighlighted];
|
||||
} [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
if (iOSVersion >= 7.0)
|
||||
{
|
||||
btn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -15);
|
||||
}
|
||||
// if (iOSVersion >= 7.0)
|
||||
// {
|
||||
// btn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -15);
|
||||
// }
|
||||
|
||||
UIBarButtonItem *barItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
|
||||
return barItem;
|
||||
@@ -231,10 +231,10 @@
|
||||
}
|
||||
[btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
if (iOSVersion >= 7.0)
|
||||
{
|
||||
btn.imageEdgeInsets = UIEdgeInsetsMake(0, -15, 0, 0);
|
||||
}
|
||||
// if (iOSVersion >= 7.0)
|
||||
// {
|
||||
// btn.imageEdgeInsets = UIEdgeInsetsMake(0, -15, 0, 0);
|
||||
// }
|
||||
|
||||
UIBarButtonItem *barItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
|
||||
return barItem;
|
||||
|
||||
@@ -8,9 +8,16 @@
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface LoginViewController : UIViewController
|
||||
@interface LoginViewController : UIViewController<UINavigationControllerDelegate>
|
||||
- (IBAction)qqLoginBtnClick:(id)sender;
|
||||
- (IBAction)weixinLoginBtnClick:(id)sender;
|
||||
- (IBAction)closeBtnClick:(id)sender;
|
||||
|
||||
@property (strong, nonatomic)void (^loginSuccessBlock)();
|
||||
|
||||
|
||||
+ (LoginViewController *)shareLoginViewController;
|
||||
|
||||
|
||||
+ (void)presentLoginViewControllerInView:(UIViewController *)vc success:(void (^)(void))completion;
|
||||
@end
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#import "LoginViewController.h"
|
||||
#import "LoginViewModel.h"
|
||||
#import "UMSocial.h"
|
||||
#import "AppDelegate.h"
|
||||
@interface LoginViewController ()
|
||||
|
||||
@end
|
||||
@@ -117,7 +118,13 @@
|
||||
[AWordUser sharedInstance].userName = name;
|
||||
[AWordUser sharedInstance].userAvatar = figureUrl;
|
||||
[AWordUser sharedInstance].userGender = gender;
|
||||
[self closeBtnClick:nil];
|
||||
[self dismissViewControllerAnimated:YES completion:^{
|
||||
if (self.loginSuccessBlock)
|
||||
{
|
||||
self.loginSuccessBlock();
|
||||
self.loginSuccessBlock = nil;
|
||||
}
|
||||
}];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLoginSuccessNotificationName object:nil];
|
||||
}else{
|
||||
[MBProgressHUD errorHudWithView:self.view label:kSSoErrorTips hidesAfter:1.0];
|
||||
@@ -126,4 +133,36 @@
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
+ (LoginViewController *)shareLoginViewController
|
||||
{
|
||||
static LoginViewController *loginVC = nil;
|
||||
if (loginVC == nil)
|
||||
{
|
||||
loginVC = [[LoginViewController alloc] initWithNibName:nil bundle:nil];
|
||||
}
|
||||
return loginVC;
|
||||
}
|
||||
|
||||
+ (void)presentLoginViewControllerInView:(UIViewController *)vc success:(void (^)(void))completion
|
||||
{
|
||||
//已登录
|
||||
if ([AWordUser sharedInstance].isLogin)
|
||||
{
|
||||
if (completion) completion();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!vc)
|
||||
{
|
||||
vc = [AppDelegate visibleViewController];
|
||||
}
|
||||
|
||||
LoginViewController *loginVC = [LoginViewController shareLoginViewController];
|
||||
loginVC.loginSuccessBlock = completion;
|
||||
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:loginVC];
|
||||
nav.delegate = loginVC;
|
||||
[vc presentViewController:nav animated:YES completion:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -119,8 +119,7 @@
|
||||
{
|
||||
if (![AWordUser sharedInstance].isLogin)
|
||||
{
|
||||
LoginViewController* loginViewController = [[LoginViewController alloc] init];
|
||||
[self.navigationController presentViewController:[[UINavigationController alloc] initWithRootViewController:loginViewController] animated:YES completion:nil];
|
||||
[LoginViewController presentLoginViewControllerInView:self success:nil];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@
|
||||
|
||||
self.navigationItem.title = @"文字";
|
||||
self.navigationItem.leftBarButtonItem = [Ash_UIUtil leftBarButtonItemWithTarget:self action:@selector(publish) image:[UIImage imageNamed:@"navigationButtonPublish"] highlightedImage:[UIImage imageNamed:@"navigationButtonPublishClick"]];
|
||||
|
||||
[self headerRereshing];
|
||||
self.navigationItem.rightBarButtonItem = [Ash_UIUtil leftBarButtonItemWithTarget:self action:@selector(headerBeginRefreshing) image:[UIImage imageNamed:@"navigationButtonRefresh"] highlightedImage:[UIImage imageNamed:@"navigationButtonRefreshClick"]];
|
||||
[self headerBeginRefreshing];
|
||||
}
|
||||
|
||||
#pragma mark MJRefreshDelegate
|
||||
@@ -137,6 +137,10 @@
|
||||
if (buttonIndex == 1) {
|
||||
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
|
||||
}
|
||||
if(buttonIndex == 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
[self presentViewController:picker animated:YES completion:nil];
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user