//
//  RDSBaseViewController.h
//  SmartLightForBigFish
//
//  Created by coderYK on 2017/8/7.
//  Copyright © 2017年 RD-iOS. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UINavigationController+FDFullscreenPopGesture.h"
#import "RDSBarButtonItem.h"

@interface RDSBaseViewController : UIViewController

@property (nonatomic, weak) UIActivityIndicatorView *juHua;
@property (nonatomic, assign) BOOL isOnline;// 是否在线 
@property (nonatomic, assign) BOOL isActive;// 是否正在屏幕上显示

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated;
- (UIViewController *)popViewControllerAnimated:(BOOL)animated;
- (NSArray *)popToViewController:(UIViewController *)viewController animated:(BOOL)animated;
- (void)popToRootViewControllerAnimated:(BOOL)animated;
- (void)rds_centerPushViewController:(UIViewController *)viewController;

// 修改导航栏颜色
- (void)updateNavigationBarColor:(UIColor *)color;
- (void)clearColorNavBar;

// 设置控件的圆角和边框
- (void)rds_setupArcView:(UIView *)view; // 默认圆角半径为5
- (void)rds_setupArcBorderView:(UIView *)view; // 默认圆角半径为5
- (void)rds_setupArcBorderView:(UIView *)view withCornerRadius:(CGFloat)radius;


- (UIButton *)rds_addSaveBtnOnNavBarWithAction:(SEL)action;

- (void)rds_addAddBtnOnNavBarWithAction:(SEL)action;

- (UIBarButtonItem *)rds_barButtonItemWithImage:(NSString *)imageName andAction:(SEL)action;




/// 弹窗提示信息
- (void)rds_alertMessage:(NSString *)message;

- (void)rds_showJuHuaOnWindow;

/// 弹窗提示信息,可选操作
- (void)rds_alertMessage:(NSString *)message doneAction:(void(^)(void))doneActionBlock;

- (void)rds_alertInputTitle:(NSString *)title msg:(NSString *)msg placeholder:(NSString *)placeholder doneAction:(void(^)(NSString *name))doneActionBlock;

- (void)rds_alertTimePickerTitle:(NSString *)title date:(NSDate *)date doneAction:(void(^)(NSDate *date))doneActionBlock;



- (void)rds_showControllerOnWindow;
- (void)rds_dismissControllerOnWindow;

- (NSString *)rds_getHexNameFromString:(NSString *)name withByte:(NSUInteger)byte;
- (NSString *)rds_stringTohexString:(NSString *)string;

/**
 创建navBarItems

 @param image item的图标
 @param target 动作执行者
 @param selector 执行的方法
 @param need 是否需要调整间距
 */
- (NSArray<UIBarButtonItem *> *)rds_barItemsWithImage:(UIImage *)image target:(id)target andSelector:(SEL)selector needAdjustSpace:(BOOL)need;






@end
