KWMBaseVC.h 2.42 KB
Newer Older
houweibin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
//
//  KWMBaseVC.h
//  iBallsoul
//
//  Created by Yaotian on 3/25/16.
//  Copyright © 2016 kwm. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "KWMAPIManager.h"
#import "KWMUserDao.h"
//#import <MAMapKit/MAMapKit.h>
//#import <AMapLocationKit/AMapLocationKit.h>
#import "AppDelegate.h"
#import <SDWebImage/UIImageView+WebCache.h>
16
#import "MZFormSheetPresentationViewController.h"
houweibin committed
17
#import "Buy/Buy.h"
18
#import <PPNetworkHelper/PPNetworkCache.h>
houweibin committed
19 20 21 22 23 24 25 26 27 28 29 30 31


@class AppDelegate;

@interface KWMBaseVC : UIViewController

@property (nonatomic,weak) AppDelegate *appDelegate;
@property (nonatomic) KWMAPIManager *api;
@property (nonatomic) BUYClient *client;
@property (nonatomic) KWMUserDao *userDao;
@property (nonatomic) CGFloat keyboardHeight;

+ (NSString *)kwmTag;
u  
lee committed
32
+ (NSString *)kwmBoard;
houweibin committed
33 34
+ (KWMBaseVC *)findControllerBy:(NSString *)controllerId
                 fromStoryboard:(NSString *)storyboardName;
u  
lee committed
35
+ (instancetype) getNewInstance;
houweibin committed
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

- (void(^)(NSURLSessionDataTask *, NSError *))defaultFailure;
- (void)popDelay;
- (void)popDelay:(NSTimeInterval)sec;
- (void)showEmptyView:(NSInteger)type setTips:(NSString *)tips;
- (void)hideEmptyView;
- (void)showLoading;
- (void)showLoading:(UIView *)view cancelable:(BOOL)isCancelable loadingBg:(UIColor *) color;
- (void)hideLoading;

- (void)showToast:(NSString *)message;
- (void)showDialog:(NSString *)message;

- (void)reLoadData;
- (void)loadData;

houweibin committed
52
- (BOOL)checkLogin;
houweibin committed
53 54 55 56 57 58 59 60 61 62 63

- (void)transparentNavigationBar;
- (void)unTransparentNavigationBar;

- (void)showError:(NSError *)error;
- (BOOL)hasError:(id)result;
- (BOOL)hasCemaroseError:(KWMCemaroseResult *)result;

- (void)keyboardWillHide:(NSNotification *)notification;
- (void)keyboardWillShow:(NSNotification *)notification;
- (void)keyboardWillChangeFrame:(NSNotification *)notification;
houweibin committed
64
- (void)initCustomTitleBarConstarints:(UIView *)titleView;
houweibin committed
65 66 67 68
- (UIBarButtonItem *)createBarButtonItem:(NSString *)title
                                   image:(UIImage *)image
                                  action:(SEL)action;

69
- (MZFormSheetPresentationViewController *)showPresentation:(UIViewController *)vc size:(CGSize)size tapOutsideClose:(BOOL)tapOutsideClose style:(MZFormSheetPresentationTransitionStyle)style;
70

houweibin committed
71 72 73
/**将URL转成UIImage*/
- (void)sd_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(SDWebImageOptions)options progress:(SDWebImageDownloaderProgressBlock)progressBlock completed:(SDWebImageCompletionBlock)completedBlock;
@end