BaseViewController.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. //
  2. // BaseViewController.h
  3. // IBOSS
  4. //
  5. // Created by iHope on 17-7-7.
  6. // Copyright (c) 2017年 沈阳东科云信软件有限公司. All rights reserved.
  7. //
  8. // 功能描述:控制器基础类
  9. //
  10. #import <UIKit/UIKit.h>
  11. #import "CommonCrypto/CommonDigest.h"
  12. #import "sys/utsname.h"
  13. #import "UserInfoManager.h"
  14. #import "NewMBProgressHUD.h"
  15. @interface BaseViewController : UIViewController {
  16. }
  17. /**
  18. 进度条
  19. */
  20. @property (nonatomic,strong) MBProgressHUD *hud;
  21. /**
  22. 进度条
  23. */
  24. @property (nonatomic,strong) NewMBProgressHUD *hudNew;
  25. /**
  26. 加载消息
  27. */
  28. @property (nonatomic, retain) NSString *mLoadMsg;
  29. /**
  30. 代理
  31. */
  32. @property (nonatomic, assign) id delegate;
  33. /**
  34. 返回sel
  35. */
  36. @property (nonatomic, assign) SEL onGoBack;
  37. /**
  38. 标题
  39. */
  40. @property (nonatomic, strong) UILabel *mlbTitle;
  41. /**
  42. 标题颜色
  43. */
  44. @property (nonatomic, retain) UIColor *mTitleColor;
  45. /**
  46. 顶部颜色
  47. */
  48. @property (nonatomic, retain) UIColor *mTopColor;
  49. /**
  50. 顶部图片
  51. */
  52. @property (nonatomic, retain) UIImage *mTopImage;
  53. /**
  54. 右导航标示
  55. */
  56. @property (nonatomic, assign) BOOL mbLightNav;
  57. /**
  58. ip地址
  59. @return <#return value description#>
  60. */
  61. - (NSString *)IPAddress;
  62. /**
  63. 将数据转换成字符串
  64. @param arr <#arr description#>
  65. @return <#return value description#>
  66. */
  67. - (NSString *)getArrToString:(NSArray *)arr;
  68. /**
  69. md5加密
  70. @param str <#str description#>
  71. @return <#return value description#>
  72. */
  73. - (NSString *) md5:(NSString *)str;
  74. /**
  75. 设备信息
  76. */
  77. - (void)getDeviceAndOSInfo;
  78. /**
  79. 进度条加载中。。。。
  80. */
  81. - (void)showLoading;
  82. /**
  83. 进度条隐藏
  84. */
  85. - (void)hideLoading;
  86. /**
  87. 标题
  88. @param text <#text description#>
  89. */
  90. - (void)showTitle:(NSString*)text;
  91. /**
  92. 标题
  93. @param text <#text description#>
  94. @param nav <#nav description#>
  95. */
  96. - (void)showTitle:(NSString*)text navi:(UINavigationController*)nav;
  97. /**
  98. 文本加载中
  99. @param text <#text description#>
  100. */
  101. - (void)showLoadingText:(NSString*)text;
  102. /**
  103. 显示消息
  104. @param text <#text description#>
  105. */
  106. - (void)showAlertViewText:(NSString *)text;
  107. /**
  108. 显示消息
  109. @param text <#text description#>
  110. */
  111. - (void)showAlertViewBackText:(NSString *)text;
  112. /**
  113. 返回按钮事件
  114. */
  115. - (void)goBack;
  116. /**
  117. 回到主页
  118. */
  119. - (void)goHome;
  120. /**
  121. 加载进度条开始
  122. */
  123. - (void)startLoading;
  124. /**
  125. 进度条结束
  126. */
  127. - (void)stopLoading;
  128. /**
  129. 加载进度条开始
  130. */
  131. - (void)startNewLoading;
  132. /**
  133. 进度条结束
  134. */
  135. - (void)stopNewLoading;
  136. /**
  137. 显示消息
  138. @param msg <#msg description#>
  139. */
  140. - (void)showMsg:(NSString *)msg;
  141. /**
  142. 隐藏logo
  143. */
  144. - (void)hideLogo;
  145. /**
  146. 显示logo
  147. @param iOffset <#iOffset description#>
  148. */
  149. - (void)showLogo:(int)iOffset;
  150. /**
  151. 导航栏清空
  152. */
  153. - (void)clearNavItem;
  154. /**
  155. 导航栏右侧文本
  156. @param name <#name description#>
  157. @param target <#target description#>
  158. @param action <#action description#>
  159. */
  160. - (void)addRightTextBtn:(NSString *)name target:(id)target action:(SEL)action;
  161. /**
  162. 航栏右侧图片
  163. @param image <#image description#>
  164. @param target <#target description#>
  165. @param action <#action description#>
  166. */
  167. - (void)addRightImageBtn:(UIImage *)image target:(id)target action:(SEL)action;
  168. /**
  169. 航栏左侧图片
  170. @param image <#image description#>
  171. @param target <#target description#>
  172. @param action <#action description#>
  173. */
  174. - (void)addLeftImageBtn:(UIImage *)image target:(id)target action:(SEL)action;
  175. /**
  176. 图片按钮
  177. @param image <#image description#>
  178. @param target <#target description#>
  179. @param action <#action description#>
  180. @return <#return value description#>
  181. */
  182. - (UIButton *)getImageButton:(UIImage *)image target:(id)target action:(SEL)action;
  183. /**
  184. UIBarButtonItem
  185. @param image <#image description#>
  186. @param target <#target description#>
  187. @param action <#action description#>
  188. @return <#return value description#>
  189. */
  190. - (UIBarButtonItem *)getImageBarItem:(UIImage *)image target:(id)target action:(SEL)action;
  191. /**
  192. 航栏右侧图片数组
  193. @param array <#array description#>
  194. */
  195. - (void)addRightImageBtns:(NSArray *)array;
  196. /**
  197. 刷新导航单颜色
  198. */
  199. - (void)refreshNavColor;
  200. /**
  201. uiview
  202. @return <#return value description#>
  203. */
  204. - (UIView *)getInputAccessoryView;
  205. /**
  206. 异常登录
  207. */
  208. - (void)showReLoginDialog;
  209. /**
  210. 异常登录
  211. @param message <#message description#>
  212. */
  213. - (void)showReLoginDialog:(NSString *)message ;
  214. /**
  215. 无数据的view
  216. @param frame <#frame description#>
  217. @return <#return value description#>
  218. */
  219. - (UIView *)noDataViewByFrame:(CGRect)frame;
  220. /**
  221. 背景提示布局
  222. @param frame <#frame description#>
  223. @param str <#str description#>
  224. @return <#return value description#>
  225. */
  226. - (UIView *)backGroundPromptViewByFrame:(CGRect)frame promptStr:(NSString *)str;
  227. @end