省钱达人

DRNineNineMainViewController.m 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  1. //
  2. // DRNineNineMainViewController.m
  3. // YouHuiProject
  4. //
  5. // Created by xiaoxi on 2018/1/16.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "DRNineNineMainViewController.h"
  9. #import "DRTableView.h"
  10. #import "DRNineNineHeaderView.h"
  11. #import "DRNineNineScrollViewController.h"
  12. #import "DRNineNineTableViewCell.h"
  13. #import "DRNineNineRequestViewModel.h"
  14. #import "DRNineTableView.h"
  15. #import "DRGoodListViewController.h"
  16. #import "DRGoodDetailViewController.h"
  17. #import "PYSearch.h"
  18. #import "DRFindSearchResultViewController.h"
  19. #import "DRFindRequestViewModel.h"
  20. #import "DRGoodListCidViewController.h"
  21. #import "DRNineNineScrollChildViewController.h"
  22. static NSString *const cellID = @"DRNineNineTableViewCell";
  23. @interface DRNineNineMainViewController () <UITableViewDelegate,UITableViewDataSource,YHNineNineScrollViewControllerDelegate,YHNineNineHeaderViewDelegate,YHNineNineTableViewCellDelegate,PYSearchViewControllerDelegate>
  24. @property (nonatomic, strong) UITableView *tableView;
  25. @property (nonatomic, strong) DRNineNineHeaderView *headerView;
  26. @property (nonatomic, strong) DRNineNineScrollViewController *scrollViewController;
  27. @property (nonatomic, strong) DRNineNineModel *nineNineModel;
  28. @property (nonatomic, assign) BOOL canScroll;
  29. @property (nonatomic, strong) YYFPSLabel *fpsLabel;
  30. @property (nonatomic, strong) NSMutableArray *everyoneSearchArr;
  31. @end
  32. @implementation DRNineNineMainViewController
  33. - (void)viewWillDisappear:(BOOL)animated {
  34. [super viewWillDisappear:animated];
  35. [SVProgressHUD dismiss];
  36. }
  37. - (void)viewDidLoad {
  38. [super viewDidLoad];
  39. [self initHUD];
  40. [self initNavBar];
  41. [self request];
  42. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changedSexRequest) name:ChangeSex object:nil];
  43. }
  44. - (void)didReceiveMemoryWarning {
  45. [super didReceiveMemoryWarning];
  46. }
  47. - (void)initNavBar {
  48. self.canScroll = YES;
  49. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeScrollStatus) name:@"leaveTop" object:nil];
  50. [self.navigationBar setNavightionBarBackgroundColor:[UIColor clearColor]];
  51. // NSInteger sex = [[[NSUserDefaults standardUserDefaults] objectForKey:UserSexKey] integerValue];
  52. // if (sex == 0) {
  53. // [self.navigationBar setNavightionBarBackgroundColor:[UIColor YHColorWithHex:0xff8daa]];
  54. // } else {
  55. // [self.navigationBar setNavightionBarBackgroundColor:[UIColor YHColorWithHex:0x98befd]];
  56. // }
  57. UIButton *search = [UIButton buttonWithType:UIButtonTypeCustom];
  58. search.frame = CGRectMake(0, 0, FITSIZE(22), FITSIZE(22));
  59. search.backgroundColor = [UIColor clearColor];
  60. [search setBackgroundImage:[UIImage imageNamed:@"search"] forState:UIControlStateNormal];
  61. [search addTarget:self action:@selector(searchButtonAction) forControlEvents:UIControlEventTouchUpInside];
  62. [self.navigationBar setCustomRightButtons:@[search]];
  63. UIImageView *titleImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.navigationBar.width/2-FITSIZE(116)/2, KStatusBarHeight+22-FITSIZE(25)/2, FITSIZE(116), FITSIZE(25))];
  64. titleImageView.backgroundColor = [UIColor clearColor];
  65. titleImageView.image = [UIImage imageNamed:@"99navBar"];
  66. [self.navigationBar addSubview:titleImageView];
  67. UIButton *leftBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 40)];
  68. [leftBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
  69. [leftBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
  70. [self.navigationBar setCustomLeftButtons:@[leftBtn]];
  71. leftBtn.hidden = !self.showBackButton;
  72. }
  73. - (void)backAction {
  74. [self.navigationController popViewControllerAnimated:YES];
  75. }
  76. - (void)searchButtonAction {
  77. [self createSearchViewControllerWith:nil];
  78. }
  79. #pragma mark notify
  80. - (void)changeScrollStatus//改变主视图的状态
  81. {
  82. self.canScroll = YES;
  83. self.scrollViewController.childCanScroll = NO;
  84. }
  85. - (void)initSubviews {
  86. [SVProgressHUD dismiss];
  87. [self.view addSubview:self.tableView];
  88. self.tableView.tableHeaderView = self.headerView;
  89. [self.tableView reloadData];
  90. [self.view bringSubviewToFront:self.navigationBar];
  91. _fpsLabel = [YYFPSLabel new];
  92. [_fpsLabel sizeToFit];
  93. _fpsLabel.bottom = kScreenHeight - TabbarHeight;
  94. _fpsLabel.left = 0;
  95. _fpsLabel.alpha = 0;
  96. // [self.view addSubview:_fpsLabel];
  97. }
  98. #pragma mark - HUD
  99. - (void)initHUD {
  100. [SVProgressHUD setDefaultStyle:SVProgressHUDStyleCustom];
  101. [SVProgressHUD setForegroundColor:[UIColor YHColorWithHex:0xff2420]];
  102. [SVProgressHUD setBackgroundColor:[UIColor YHColorWithHex:0xf5f4f4]];
  103. }
  104. #pragma mark - request
  105. - (void)request {
  106. [SVProgressHUD show];
  107. [self requestGoodList];
  108. [self requestEveryoneSearch];
  109. }
  110. - (void)changedSexRequest {
  111. NSInteger sex = [[[NSUserDefaults standardUserDefaults] objectForKey:UserSexKey] integerValue];
  112. if (sex == 0) {
  113. self.headerView.backgroundColor = [UIColor YHColorWithHex:0xff8daa];
  114. [self.navigationBar setNavightionBarBackgroundColor:[UIColor YHColorWithHex:0xff8daa]];
  115. } else {
  116. self.headerView.backgroundColor = [UIColor YHColorWithHex:0x98befd];
  117. [self.navigationBar setNavightionBarBackgroundColor:[UIColor YHColorWithHex:0x98befd]];
  118. }
  119. [self.everyoneSearchArr removeAllObjects];
  120. [self.scrollViewController removeFromParentViewController];
  121. self.scrollViewController = nil;
  122. [self request];
  123. }
  124. - (void)requestGoodList {
  125. [DRNineNineRequestViewModel requestNineNineGoodListParamGid:1 success:^(DRNineNineModel *model) {
  126. if (model) {
  127. self.nineNineModel = model;
  128. self.headerView.headerModel = model.hot;
  129. [self initSubviews];
  130. }
  131. [self.tableView.mj_header endRefreshing];
  132. } failure:^(NSError *error) {
  133. [SVProgressHUD dismiss];
  134. [self.tableView.mj_header endRefreshing];
  135. }];
  136. }
  137. - (void)requestEveryoneSearch {
  138. [DRFindRequestViewModel requestEveryoneSearchSuccess:^(NSArray *array) {
  139. if (array.count > 0) {
  140. for (NSDictionary *dict in array) {
  141. [self.everyoneSearchArr addObject:dict];
  142. }
  143. }
  144. } failure:^(NSError *error) {
  145. }];
  146. }
  147. #pragma mark - nineNineHeaderViewDelegate
  148. - (void)yh_NineNineHeaderViewDidSelectItem:(YHNineNineHeaderCollectionModel *)model {
  149. if (model.cid.length) {
  150. DRGoodListCidViewController *listVC = [[DRGoodListCidViewController alloc] init];
  151. listVC.goods_id = model.Id.stringValue;
  152. listVC.cid = model.cid;
  153. listVC.topRequest = 2;
  154. [self.navigationController pushViewController:listVC animated:YES];
  155. }
  156. else {
  157. DRGoodListViewController *listVC = [[DRGoodListViewController alloc] init];
  158. listVC.cate_id = model.Id.stringValue;
  159. listVC.topRequest = 2;
  160. [self.navigationController pushViewController:listVC animated:YES];
  161. }
  162. [MobClick event:nine_top_pic];
  163. }
  164. #pragma mark - nineNineTableViewCellDelegate
  165. - (void)yh_NineNineTableViewCellDidSelectItem:(YHNineNineMiddleModel *)model {
  166. if (model.title.cid.length) {
  167. DRGoodListCidViewController *listVC = [[DRGoodListCidViewController alloc] init];
  168. listVC.goods_id = model.title.Id.stringValue;
  169. listVC.cid = model.title.cid;
  170. listVC.topRequest = 2;
  171. [self.navigationController pushViewController:listVC animated:YES];
  172. }
  173. else {
  174. DRGoodListViewController *listVC = [[DRGoodListViewController alloc] init];
  175. listVC.cate_id = model.title.Id.stringValue;
  176. listVC.topRequest = 2;
  177. [self.navigationController pushViewController:listVC animated:YES];
  178. }
  179. [MobClick event:nine_better];
  180. }
  181. #pragma mark - nineNineScrollViewControllerDelegate
  182. - (void)yh_NineNineScrollViewControllerDidSelectItem:(DRChildGoodModel *)model {
  183. if ([model.type isEqualToString:@"0"]) {
  184. //详情
  185. DRGoodDetailViewController *detailVC = [[DRGoodDetailViewController alloc] init];
  186. DetailRequestModel *requestModel = [[DetailRequestModel alloc] initWithChildModel:model];
  187. detailVC.requestModel = requestModel;
  188. [self.navigationController pushViewController:detailVC animated:YES];
  189. }
  190. else {
  191. if (model.cid.length) {
  192. DRGoodListCidViewController *listVC = [[DRGoodListCidViewController alloc] init];
  193. listVC.goods_id = model.goods_id;
  194. listVC.cid = model.cid;
  195. listVC.topRequest = 1;
  196. [self.navigationController pushViewController:listVC animated:YES];
  197. }
  198. else {
  199. //专场
  200. DRGoodListViewController *listVC = [[DRGoodListViewController alloc] init];
  201. listVC.cate_id = model.goods_id;
  202. listVC.topRequest = 1;
  203. [self.navigationController pushViewController:listVC animated:YES];
  204. }
  205. }
  206. }
  207. #pragma mark - search
  208. - (void)createSearchViewControllerWith:(NSString *)text {
  209. PYSearchViewController *searchViewController = [PYSearchViewController searchViewControllerWithHotSearches:@[] searchBarPlaceholder:@"输入商品名或粘贴淘宝标题"];
  210. searchViewController.swapHotSeachWithSearchHistory = YES;
  211. searchViewController.searchHistoryStyle = PYSearchHistoryStyleARCBorderTag;
  212. searchViewController.hotSearchStyle = PYHotSearchStyleARCBorderTag;
  213. searchViewController.searchTextField.font = [UIFont systemFontOfSize:13];
  214. searchViewController.delegate = self;
  215. searchViewController.searchBar.text = text;
  216. [self getHotSearchToSearchViewController:searchViewController];
  217. UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:searchViewController];
  218. [self presentViewController:nav animated:NO completion:^{
  219. for (int i = 0; i < searchViewController.hotSearchTags.count; i++) {
  220. UILabel *tag = searchViewController.hotSearchTags[i];
  221. NSDictionary *dic = self.everyoneSearchArr[i];
  222. if ([dic[@"color"] boolValue]) {
  223. tag.layer.borderColor = [UIColor homeRedColor].CGColor;
  224. tag.textColor = [UIColor homeRedColor];
  225. }
  226. }
  227. }];
  228. searchViewController.didSearchBlock = ^(PYSearchViewController *searchViewController, UISearchBar *searchBar, NSString *searchText) {
  229. [MobClick event:search_count label:Search_Normal];
  230. //处理搜索点击事件
  231. DRFindSearchResultViewController *resultVC = [[DRFindSearchResultViewController alloc] init];
  232. resultVC.searchName = searchText;
  233. [nav pushViewController:resultVC animated:NO];
  234. };
  235. }
  236. /**
  237. 加载热搜词汇
  238. */
  239. - (void)getHotSearchToSearchViewController:(PYSearchViewController *)searchViewController {
  240. NSMutableArray *hotSearch = [NSMutableArray array];
  241. for (NSDictionary *dic in self.everyoneSearchArr) {
  242. [hotSearch addObject:dic[@"name"]];
  243. }
  244. searchViewController.hotSearches = hotSearch;
  245. }
  246. #pragma mark - PYSearchViewControllerDelegate
  247. /**
  248. 输入完成时触发
  249. */
  250. - (void)searchViewController:(PYSearchViewController *)searchViewController searchTextDidChange:(UISearchBar *)seachBar searchText:(NSString *)searchText
  251. {
  252. if (searchText.length) {
  253. [DRHttp get:SearchAdvice params:@{@"name":searchText} success:^(id json) {
  254. NSArray *list = json[@"data"];
  255. searchViewController.searchSuggestions = list;
  256. } failure:^(NSError *error) {
  257. }];
  258. }
  259. }
  260. /**
  261. 点击建议
  262. */
  263. - (void)searchViewController:(PYSearchViewController *)searchViewController
  264. didSelectSearchSuggestionAtIndex:(NSInteger)index
  265. searchText:(NSString *)searchText {
  266. DRFindSearchResultViewController *resultVC = [[DRFindSearchResultViewController alloc] init];
  267. resultVC.searchName = searchText;
  268. [searchViewController.navigationController pushViewController:resultVC animated:NO];
  269. }
  270. /**
  271. 点击热搜
  272. */
  273. - (void)searchViewController:(PYSearchViewController *)searchViewController
  274. didSelectHotSearchAtIndex:(NSInteger)index
  275. searchText:(NSString *)searchText {
  276. DRFindSearchResultViewController *resultVC = [[DRFindSearchResultViewController alloc] init];
  277. resultVC.searchName = searchText;
  278. [searchViewController.navigationController pushViewController:resultVC animated:NO];
  279. [MobClick event:search_count label:Search_Hot_String];
  280. }
  281. /**
  282. 点击历史
  283. */
  284. - (void)searchViewController:(PYSearchViewController *)searchViewController
  285. didSelectSearchHistoryAtIndex:(NSInteger)index
  286. searchText:(NSString *)searchText {
  287. DRFindSearchResultViewController *resultVC = [[DRFindSearchResultViewController alloc] init];
  288. resultVC.searchName = searchText;
  289. [searchViewController.navigationController pushViewController:resultVC animated:NO];
  290. [MobClick event:search_count label:Search_History_String];
  291. }
  292. #pragma mark - tableView
  293. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  294. return 2;
  295. }
  296. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  297. if (section == 0) {
  298. return self.nineNineModel.recommend.count;
  299. }
  300. else {
  301. return 0;
  302. }
  303. }
  304. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  305. DRNineNineTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
  306. cell.delegate = self;
  307. YHNineNineMiddleModel *model = self.nineNineModel.recommend[indexPath.row];
  308. cell.model = model;
  309. return cell;
  310. }
  311. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  312. if (section == 0) {
  313. return [[UIView alloc] init];
  314. }
  315. else {
  316. return self.scrollViewController.view;
  317. }
  318. }
  319. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  320. if (section == 0) {
  321. return 0.1;
  322. }
  323. else {
  324. return kScreenHeight-NavBarHeight;
  325. }
  326. }
  327. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  328. if (indexPath.section == 0) {
  329. return FITSIZE(240);
  330. }
  331. else {
  332. return 0.1;
  333. }
  334. }
  335. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  336. YHNineNineMiddleModel *model = self.nineNineModel.recommend[indexPath.row];
  337. if (model.title.cid.length) {
  338. DRGoodListCidViewController *listVC = [[DRGoodListCidViewController alloc] init];
  339. listVC.goods_id = model.title.Id.stringValue;
  340. listVC.cid = model.title.cid;
  341. listVC.topRequest = 2;
  342. [self.navigationController pushViewController:listVC animated:YES];
  343. }
  344. else {
  345. DRGoodListViewController *listVC = [[DRGoodListViewController alloc] init];
  346. listVC.cate_id = model.title.Id.stringValue;
  347. listVC.topRequest = 2;
  348. [self.navigationController pushViewController:listVC animated:YES];
  349. }
  350. }
  351. #pragma mark - scrollView
  352. - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
  353. if (scrollView.contentOffset.y >= 0) {
  354. NSInteger sex = [[[NSUserDefaults standardUserDefaults] objectForKey:UserSexKey] integerValue];
  355. if (sex == 0) {
  356. [self.navigationBar setNavightionBarBackgroundColor:[UIColor YHColorWithHex:0xff8daa]];
  357. } else {
  358. [self.navigationBar setNavightionBarBackgroundColor:[UIColor YHColorWithHex:0x98befd]];
  359. }
  360. self.tableView.backgroundView.backgroundColor = [UIColor clearColor];
  361. self.tableView.backgroundColor = [UIColor clearColor];
  362. }
  363. else {
  364. [self.navigationBar setNavightionBarBackgroundColor:[UIColor clearColor]];
  365. NSInteger sex = [[[NSUserDefaults standardUserDefaults] objectForKey:UserSexKey] integerValue];
  366. if (sex == 0) {
  367. self.tableView.backgroundView.backgroundColor = [UIColor YHColorWithHex:0xff8daa];
  368. self.tableView.backgroundColor = [UIColor YHColorWithHex:0xff8daa];
  369. } else {
  370. self.tableView.backgroundView.backgroundColor = [UIColor YHColorWithHex:0x98befd];
  371. self.tableView.backgroundColor = [UIColor YHColorWithHex:0x98befd];
  372. }
  373. }
  374. CGFloat offY = scrollView.contentOffset.y;
  375. CGFloat height = [self.tableView rectForSection:1].origin.y - NavBarHeight;
  376. if (offY >= height) {
  377. [self.tableView setContentOffset:CGPointMake(0, height)];
  378. if (self.canScroll) {
  379. self.canScroll = NO;
  380. self.scrollViewController.childCanScroll = YES;
  381. }
  382. }else {
  383. if (!self.canScroll) {//子视图没到顶部
  384. scrollView.contentOffset = CGPointMake(0, height);
  385. }
  386. }
  387. }
  388. - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
  389. if (_fpsLabel.alpha == 0) {
  390. [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
  391. _fpsLabel.alpha = 1;
  392. } completion:NULL];
  393. }
  394. }
  395. - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
  396. if (!decelerate) {
  397. if (_fpsLabel.alpha != 0) {
  398. [UIView animateWithDuration:1 delay:2 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
  399. _fpsLabel.alpha = 0;
  400. } completion:NULL];
  401. }
  402. }
  403. }
  404. - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
  405. if (_fpsLabel.alpha != 0) {
  406. [UIView animateWithDuration:1 delay:2 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
  407. _fpsLabel.alpha = 0;
  408. } completion:NULL];
  409. }
  410. }
  411. - (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView {
  412. if (_fpsLabel.alpha == 0) {
  413. [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionBeginFromCurrentState animations:^{
  414. _fpsLabel.alpha = 1;
  415. } completion:^(BOOL finished) {
  416. }];
  417. }
  418. }
  419. #pragma mark - lazy
  420. - (UITableView *)tableView {
  421. if (!_tableView) {
  422. // CGFloat height = self.showBackButton?SCREEN_HEIGHT:SCREEN_HEIGHT-TabbarHeight;
  423. _tableView = [[DRNineTableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) style:UITableViewStylePlain];
  424. _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
  425. _tableView.backgroundView.backgroundColor = [UIColor clearColor];
  426. _tableView.backgroundColor = [UIColor clearColor];
  427. _tableView.showsVerticalScrollIndicator = NO;
  428. _tableView.estimatedRowHeight = 0;
  429. _tableView.estimatedSectionHeaderHeight = 0;
  430. _tableView.estimatedSectionFooterHeight = 0;
  431. _tableView.delegate = self;
  432. _tableView.dataSource = self;
  433. [_tableView registerClass:[DRNineNineTableViewCell class] forCellReuseIdentifier:cellID];
  434. if (@available(iOS 11.0, *)) {
  435. _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  436. }
  437. kWeak(self);
  438. MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
  439. [selfWeak changedSexRequest];
  440. }];
  441. header.lastUpdatedTimeLabel.textColor = [UIColor whiteColor];
  442. header.stateLabel.textColor = [UIColor whiteColor];
  443. _tableView.mj_header = header;
  444. }
  445. return _tableView;
  446. }
  447. - (DRNineNineHeaderView *)headerView {
  448. if (!_headerView) {
  449. _headerView = [[DRNineNineHeaderView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, FITSIZE((197+NavBarHeight)))];
  450. _headerView.delegate = self;
  451. }
  452. return _headerView;
  453. }
  454. - (DRNineNineScrollViewController *)scrollViewController {
  455. if (!_scrollViewController) {
  456. _scrollViewController = [[DRNineNineScrollViewController alloc] init];
  457. _scrollViewController.delegate = self;
  458. [self addChildViewController:_scrollViewController];
  459. }
  460. return _scrollViewController;
  461. }
  462. - (NSMutableArray *)everyoneSearchArr {
  463. if (!_everyoneSearchArr) {
  464. _everyoneSearchArr = [NSMutableArray array];
  465. }
  466. return _everyoneSearchArr;
  467. }
  468. @end