KWMBaseVC.h 2.21 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 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
#import "Buy/Buy.h"


@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;
+ (KWMBaseVC *)findControllerBy:(NSString *)controllerId
                 fromStoryboard:(NSString *)storyboardName;

- (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;


- (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;
- (UIBarButtonItem *)createBarButtonItem:(NSString *)title
                                   image:(UIImage *)image
                                  action:(SEL)action;

64 65
- (void)showPresentation:(UIViewController *)vc size:(CGSize)size tapOutsideClose:(BOOL)tapOutsideClose style:(MZFormSheetPresentationTransitionStyle)style;

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