123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566 |
- //
- // FKRecommendController.m
- // FirstLink
- //
- // Created by jack on 15/11/30.
- // Copyright © 2015年 FirstLink. All rights reserved.
- //
- #import "FKRecommendPageController.h"
- #import "FKRecommendController.h"
- #import "FKRecommendRequest.h"
- #import "FKRecommendReform.h"
- #import "GuideViewController.h"
- #import "FKExploreKeywordController.h"
- #import "FKExploreListController.h"
- #import "FKEntireCategoryController.h"
- #import "FKMyBookController.h"
- #import <HMSegmentedControl/HMSegmentedControl.h>
- #import "FKGuideManager.h"
- #import "FLControllerHelper.h"
- #import "UserDefaultManager.h"
- #import "FKWindowViewManager.h"
- #import "FKRemoteConfigManager.h"
- #import "FKLaunchAnimation.h"
- #import "FLControllerHelper.h"
- #import "FKBrandEntryBtn.h"
- #import "FLImageHelper.h"
- #import "FKNavigtionCustomTitleView.h"
- @protocol FKUIScrollViewDelegate <NSObject>
- - (BOOL)fk_gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer;
- @end
- @interface FKUIScrollView : UIScrollView
- @property (nonatomic, weak) id <FKUIScrollViewDelegate> gestureDelegate;
- @end
- @implementation FKUIScrollView
- - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer{
- if ([self.delegate respondsToSelector:@selector(fk_gestureRecognizerShouldBegin:)]){
- return [self.gestureDelegate fk_gestureRecognizerShouldBegin:gestureRecognizer];
- }
- return YES;
- }
- @end
- static NSInteger const SEARCHBAR_NORMAL_STATE_LEFT_MARGIN = 60;
- static NSInteger const SEARCHBAR_NORMAL_STATE_RIGHT_MARGIN = 60;
- @interface FKRecommendPageController () <FLNetworkDelegate, UIScrollViewDelegate, UISearchBarDelegate>
- @property (nonatomic, strong) FKNavigtionCustomTitleView *searchBarContainer;
- @property (nonatomic, strong) UISearchBar *searchBar;
- @property (nonatomic, strong) UIImageView *searchIcon;
- @property (nonatomic, strong) UILabel *searchLabel;
- @property (nonatomic, strong) FKBrandEntryBtn *brandBtn;
- @property (nonatomic, strong) HMSegmentedControl *segmentedControl;
- @property (nonatomic, strong) UIImageView *segmentedBgImgView;
- @property (nonatomic, strong) FKUIScrollView *scrollView;
- @property (nonatomic, strong) FKRecommendController *recommendController;
- @property (nonatomic, strong) NSMutableArray *webviewControllers;
- @property (nonatomic, strong) FKRecommendPageViewModel *viewModel;
- @end
- @implementation FKRecommendPageController
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self addAllSubviews];
-
- [self configErrorTipView];
- [self configBarButtonItem];
- [self configSegmentControl];
-
- [self requestPageTabData];
- }
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- [self.navigationController setNavigationBarHidden:NO animated:YES];
- self.searchLabel.text = [FKRemoteConfigManager searchPlaceholder];
-
- [self configNaviBarAndTabBar];
- [self requestBookBrandInfo];
-
- [self setupNaviControllerBgImage];
- self.navigationController.navigationBar.barStyle = UIStatusBarStyleLightContent;
- }
- - (void)viewWillDisappear:(BOOL)animated {
- [super viewWillDisappear:animated];
- self.navigationController.navigationBar.barStyle = UIStatusBarStyleDefault;
- [self cancelNaviControllerBgImage];
- }
- - (void)viewDidDisappear:(BOOL)animated {
- [super viewDidDisappear:animated];
-
- }
- - (void)viewDidAppear:(BOOL)animated {
- [super viewDidAppear:animated];
- // 请求当前是否有活动,App生命周期内最多跳转一次到活动页面
- BOOL needShowGuide = [FKGuideManager isNeedShowGuideController];
- if (!needShowGuide) {
- if ([FKLaunchAnimation isFinished]) {
- [self flushFloatViewManager];
- }
- [FKRecommendRequest requestActivityURL:REC_REQUEST_ACTIVITY_URL
- deleagate:self];
- }
-
- // 当Tab请求回来后,精选首页发生页面切换事件需要通知当前显示页面
- if (self.scrollView.contentOffset.x == 0) {
- if (self.viewModel.pageItemArray && [self.recommendController isKindOfClass:[UIViewController class]]) {
- [self.recommendController beginAppearanceTransition:YES animated:NO];
- [self.recommendController endAppearanceTransition];
- }
- }
- }
- //- (BOOL)fk_gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
- // FKRecommendCollectionViewCell * cell = (FKRecommendCollectionViewCell *)[self.collectionView cellForItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
- // if (![cell isKindOfClass:[FKRecommendCollectionViewCell class]]) return YES;
- //
- // CGPoint point = [gestureRecognizer locationInView:cell.recommendController.limitCell];
- // return !CGRectContainsPoint(cell.recommendController.limitCell.bounds, point);
- // return NO;
- //}
- #pragma mark - Request
- - (void)requestPageTabData {
- [self.statusView removeFromSuperview];
- [FKRecommendRequest requestTabPagesWithIdentify:REC_TAB_PAGE_REQ delegate:self];
- }
- - (void)requestBookBrandInfo {
- if ([FKUserManager isUserLogin]) {
- NSString *lastTime = [[NSUserDefaults standardUserDefaults] objectForKey:FK_BOOK_BRAND_SERVER_TIME_KEY];
- [FKRecommendRequest requestBookInfoWithServeTime:lastTime
- identify:REC_BOOK_BRAND_INFO
- deleagate:self];
- }
- }
- #pragma mark - response
- - (void)networkDidReceiveError:(NSError *)error identify:(int)identify header:(MSGHeader *)header{
- [self showSystemErrorTipInView:self.view];
- }
- - (void)networkDidSuccessResponse:(NSDictionary *)response identify:(int)identify header:(MSGHeader *)header {
- if (header.code.intValue == RESPONSE_MSG_NORMAL) {
- if (identify == REC_TAB_PAGE_REQ) {
- self.viewModel = [FKRecommendReform parserPageViewModelWithDict:response];
- self.segmentedBgImgView.hidden = NO;
- self.segmentedControl.sectionTitles = self.viewModel.sectionTitlesArray;
- [self.segmentedControl setNeedsDisplay];
- [self addRecommendController];
- } else if (identify == REC_REQUEST_ACTIVITY_URL) {
- NSString *url = [FKRecommendReform parserH5Url:response];
- if ([self shouldPushWebViewController:url]) {
- [self pushWebViewController:url];
-
- [[UserDefaultManager sharedManager] setUserDefaultObject:url key:LAST_ACTIVITY_URL_KEY];
- }
- return;
- } else if (identify == REC_BOOK_BRAND_INFO){
- BOOL hasInfo = [FKRecommendReform parserHasBookInfoWithDict:response];
- self.brandBtn.redPoint.hidden = !hasInfo;
- }
- } else {
- [self showSystemErrorTipInView:self.view];
- }
- }
- - (BOOL)shouldPushWebViewController:(NSString *)urlString {
- NSString *lastActivityURL = [[UserDefaultManager sharedManager] getUserDefaultObject:LAST_ACTIVITY_URL_KEY];
- if (urlString.length > 0 && ![urlString isEqualToString:lastActivityURL]) {
- return YES;
- }
- return NO;
- }
- - (void)pushWebViewController:(NSString *)urlString {
- WebViewController *newViewController = [[FLControllerHelper currentStoryBoard] instantiateViewControllerWithIdentifier:@"WebViewController"];
- newViewController.url = urlString;
- newViewController.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:newViewController animated:YES];
- }
- #pragma mark - UISearchBarDelegate
- - (BOOL)searchBarShouldBeginEditing:(UISearchBar *)searchBar {
- WeakSelf(weakSelf);
- FKExploreKeywordController *controller = [[FKExploreKeywordController alloc] initWithKeyword:nil type:FKExploreControllerTypeRemoteKeyword];
- controller.executeSearchHandler = ^(FKExploreConditionType type, NSString *itemID, NSString *keyword) {
- if (keyword.length > 0) {
- FKExploreListController *listController = [[FKExploreListController alloc] initWithSource:FKExploreListSourceKeyword];
- if (type == FKExploreConditionTypeKeyword) {
- NSArray *keywords = [keyword componentsSeparatedByString:@" "];
- for (NSString *value in keywords) {
- [listController.conditionManager addConditionWithType:FKExploreConditionTypeKeyword
- itemID:nil
- value:value];
- }
- [[FKPageRouterUtil sharedInstance] pushPageRefer:PRPageSearchKeyword values:@[keyword]];
- } else if (type == FKExploreConditionTypeBrand) {
- [listController.conditionManager addConditionWithType:FKExploreConditionTypeBrand
- itemID:nil
- value:keyword];
- [[FKPageRouterUtil sharedInstance] pushPageRefer:PRPageSearchKeyword values:@[keyword]];
- }
- listController.hidesBottomBarWhenPushed = YES;
- [weakSelf.navigationController pushViewController:listController animated:YES];
- }
- };
- [self.navigationController presentViewController:controller
- animated:NO
- completion:^{}];
-
- return NO;
- }
- #pragma mark - UIScrollViewDelegate
- - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
- [self addWebController];
- }
- - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
- CGFloat offsetX = scrollView.contentOffset.x;
- int index = (int)((offsetX + 1)/UISCREENWIDTH);
- [self.segmentedControl setSelectedSegmentIndex:index animated:YES];
- [self enableScrollToTopAtIndex:index];
- }
- #pragma mark - Action
- - (void)configSegmentControl {
- WeakSelf(weakSelf);
- self.segmentedControl.indexChangeBlock = ^(NSInteger index) {
- if (index < (weakSelf.viewModel.pageItemArray.count + 1)) {
- [weakSelf addWebController];
- [weakSelf.scrollView setContentOffset:CGPointMake(UISCREENWIDTH*index, 0) animated:YES];
- [weakSelf enableScrollToTopAtIndex:index];
- }
- };
- }
- - (void)configErrorTipView {
- [self.statusView.actionButton addTarget:self action:@selector(requestPageTabData) forControlEvents:UIControlEventTouchUpInside];
- }
- - (void)pushEntireCategoryController {
- FKEntireCategoryController *controller = [[FKEntireCategoryController alloc] init];
- controller.hidesBottomBarWhenPushed = YES;
- controller.isShowLeftBarItem = YES;
- [self.navigationController pushViewController:controller animated:YES];
- }
- - (void)clickBrandEntryBtn {
- if (![FKUserManager isUserLogin]){
- [self showLoginActionMenu];
- return;
- }
-
- FKMyBookController *book = [[FKMyBookController alloc]init];
- book.hidesBottomBarWhenPushed = YES;
- [self.navigationController pushViewController:book animated:YES];
- }
- #pragma mark - method
- - (void)addAllSubviews {
- self.searchBarContainer.frame = CGRectMake(SEARCHBAR_NORMAL_STATE_LEFT_MARGIN
- ,6
- ,(UISCREENWIDTH - SEARCHBAR_NORMAL_STATE_LEFT_MARGIN - SEARCHBAR_NORMAL_STATE_RIGHT_MARGIN)
- ,32);
- self.searchBarContainer.backgroundColor = [UIColor colorWithWhite:1 alpha:0.39];
- self.navigationItem.titleView = self.searchBarContainer;
-
- [self.searchBarContainer addSubview:self.searchLabel];
- [self.searchLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.searchBarContainer);
- make.centerX.equalTo(self.searchBarContainer).offset(8);
- }];
- [self.searchBarContainer addSubview:self.searchIcon];
- [self.searchIcon mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.equalTo(self.searchLabel.mas_left).offset(-4);
- make.centerY.equalTo(self.searchBarContainer);
- make.size.mas_equalTo(CGSizeMake(15, 15));
- }];
-
- [self.view addSubview:self.segmentedBgImgView];
- [self.segmentedBgImgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.equalTo(self.view);
- make.top.equalTo(self.view);
- make.height.mas_equalTo(44);
- }];
-
- [self.view addSubview:self.segmentedControl];
- [self.segmentedControl mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self.segmentedBgImgView);
- }];
-
- CGFloat height = (UISCREENHEIGH - 44
- - CGRectGetHeight([UIApplication sharedApplication].statusBarFrame)
- - CGRectGetHeight(self.navigationController.navigationBar.frame)
- - CGRectGetHeight(self.tabBarController.tabBar.frame));
- self.scrollView.frame = CGRectMake(0, 44, UISCREENWIDTH, height);
- self.scrollView.contentSize = CGSizeMake(UISCREENWIDTH, height);
- [self.view addSubview:self.scrollView];
- }
- - (void)addRecommendController {
- if (_recommendController == nil) {
- WeakSelf(weakSelf);
- self.recommendController.view.frame = CGRectMake(0, 0, UISCREENWIDTH, CGRectGetHeight(self.scrollView.frame));
- self.recommendController.handlePageRefreshEvent = ^() {
- [weakSelf removeWebController];
- [weakSelf requestPageTabData];
- };
- [self.scrollView addSubview:self.recommendController.view];
- }
- self.scrollView.contentSize = CGSizeMake(UISCREENWIDTH*2, CGRectGetHeight(self.scrollView.frame));
- }
- - (void)removeWebController {
- [self.scrollView.subviews enumerateObjectsUsingBlock:^(UIView *obj, NSUInteger idx, BOOL *stop) {
- if (idx != 0) {
- [obj performSelector:@selector(removeFromSuperview)];
- }
- }];
- [self.webviewControllers removeAllObjects];
- }
- - (void)addWebController {
- if (self.scrollView.subviews.count < (self.viewModel.pageItemArray.count + 1)) {
- FKRecommendPageItem *pageItem;
- WebViewController *webviewController;
- for (int idx = 0; idx < self.viewModel.pageItemArray.count; idx++) {
- pageItem = [self.viewModel pageItemAtIndex:idx];
-
- webviewController = [[WebViewController alloc] init];
- webviewController.url = pageItem.targetUrl;
- webviewController.view.frame = CGRectMake(UISCREENWIDTH*(idx+1), 0, UISCREENWIDTH, CGRectGetHeight(self.scrollView.frame));
- [self.scrollView addSubview:webviewController.view];
-
- [self.webviewControllers addObject:webviewController];
- }
- self.scrollView.contentSize = CGSizeMake(UISCREENWIDTH*(self.viewModel.pageItemArray.count + 1), CGRectGetHeight(self.scrollView.frame));
- }
- }
- - (void)hideDefaultLeftNaviItem {
- self.navigationItem.leftBarButtonItem = nil;
- }
- - (void)configNaviBarAndTabBar {
- [self.tabBarController.tabBar setHidden:NO];
- [UIApplication sharedApplication].statusBarHidden = NO;
- [self.navigationController setNavigationBarHidden:NO animated:YES];
-
- self.navigationController.navigationBar.barStyle = UIStatusBarStyleDefault;
- }
- - (void)configBarButtonItem {
- UIImage *leftImage = [[UIImage imageNamed:@"EntireCategoryIcon"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
- self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:leftImage
- style:UIBarButtonItemStylePlain
- target:self
- action:@selector(pushEntireCategoryController)];
-
- self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.brandBtn];
- [[self.brandBtn.widthAnchor constraintEqualToConstant:35] setActive:YES];
- [[self.brandBtn.heightAnchor constraintEqualToConstant:44] setActive:YES];
- }
- // 点击Statusbar置顶
- - (void)enableScrollToTopAtIndex:(NSInteger)index{
- if (index < 0) return;
- self.recommendController.tableView.scrollsToTop = NO;
- for (WebViewController *web in self.webviewControllers) {
- if ([web isKindOfClass:[WebViewController class]]){
- web.webview.scrollView.scrollsToTop = NO;
- }
- }
-
- if (index == 0) {
- self.recommendController.tableView.scrollsToTop = YES;
- }else if (index - 1 < self.webviewControllers.count){
- WebViewController *web = self.webviewControllers[index - 1];
- if ([web isKindOfClass:[WebViewController class]]){
- web.webview.scrollView.scrollsToTop = YES;
- }
- }
-
- FKRecommendPageItem *item = [self.viewModel pageItemAtIndex:index];
- if (item) {
- [FKRecommendRequest requestBehavior:@"index_menu"
- objType:@"menu"
- objID:item.pageID
- positionV1:[NSString stringWithFormat:@"%ld", (long)index]
- positionV2:nil];
- }
- }
- - (void)flushFloatViewManager {
- [[FKWindowViewManager sharedManager] showFloatView:nil];
- }
- - (void)setupNaviControllerBgImage {
- UIImage *image = [UIImage imageNamed:@"navigationcontrollerbgicon"];
- UIImage *bgImage = [FLImageHelper generateThumbnailFromBottom:image frame:CGSizeMake(UISCREENWIDTH, IS_IPHONE_X ? 88 : 64)];
- [self.navigationController.navigationBar setBackgroundImage:bgImage forBarMetrics:UIBarMetricsDefault];
- }
- - (void)cancelNaviControllerBgImage {
- [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
- }
- #pragma mark - property
- - (FKNavigtionCustomTitleView *)searchBarContainer {
- if (!_searchBarContainer) {
- _searchBarContainer = [FKNavigtionCustomTitleView new];
- _searchBarContainer.layer.cornerRadius = 6;
- _searchBarContainer.clipsToBounds = YES;
- _searchBarContainer.backgroundColor = [UIColor clearColor];//UIColorFromRGB(0xf1f1f1);
- _searchBarContainer.userInteractionEnabled = YES;
- [_searchBarContainer addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(searchBarShouldBeginEditing:)]];
- }
- return _searchBarContainer;
- }
- - (UISearchBar *)searchBar {
- if (!_searchBar) {
- _searchBar = [UISearchBar new];
- _searchBar.delegate = self;
- _searchBar.returnKeyType = UIReturnKeyDone;
- _searchBar.searchBarStyle = UISearchBarStyleMinimal;
- _searchBar.backgroundColor = [UIColor clearColor];//UIColorFromRGB(0xf1f1f1);
- // [_searchBar setSearchFieldBackgroundImage:[UIImage imageNamed:@"SearchBarBackground"] forState:UIControlStateNormal];
- }
- return _searchBar;
- }
- - (UIImageView *)searchIcon {
- if (!_searchIcon) {
- _searchIcon = [UIImageView new];
- _searchIcon.image = [UIImage imageNamed:@"searchBarIcon"];
- }
- return _searchIcon;
- }
- - (UILabel *)searchLabel {
- if (!_searchLabel) {
- _searchLabel = [[UILabel alloc] init];
- _searchLabel.textAlignment = NSTextAlignmentCenter;
- _searchLabel.textColor = UIColorFromRGB(0xffffff);
- _searchLabel.font = [UIFont systemFontOfSize:13];
- }
- return _searchLabel;
- }
- - (HMSegmentedControl *)segmentedControl {
- if (!_segmentedControl) {
- _segmentedControl = [HMSegmentedControl new];
- _segmentedControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
- _segmentedControl.selectionIndicatorHeight = 2;
- _segmentedControl.segmentEdgeInset = UIEdgeInsetsMake(0, 15, -8, 15);
- _segmentedControl.selectionIndicatorEdgeInsets = UIEdgeInsetsMake(0, 15, -8, 15);
- _segmentedControl.selectionIndicatorColor = UIColorFromRGB(0xffc66e);
- _segmentedControl.selectionStyle = HMSegmentedControlSelectionStyleTextWidthStripe;
- _segmentedControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : UIColorFromRGB(0xffc66e),
- NSFontAttributeName : [UIFont systemFontOfSize:15]};
- _segmentedControl.titleTextAttributes = @{NSForegroundColorAttributeName : UIColorFromRGB(0xffffff),
- NSFontAttributeName : [UIFont systemFontOfSize:15]};
- // _segmentedControl.borderType = HMSegmentedControlBorderTypeBottom;
- // _segmentedControl.borderColor = UIColorFromRGB(0xe5e5e5);
- // _segmentedControl.borderWidth = 0.5;
- _segmentedControl.backgroundColor = [UIColor clearColor];
-
- _segmentedControl.type = HMSegmentedControlTypeText;
- _segmentedControl.segmentWidthStyle = HMSegmentedControlSegmentWidthStyleDynamic;
- }
- return _segmentedControl;
- }
- - (UIImageView *)segmentedBgImgView {
- if (!_segmentedBgImgView) {
- _segmentedBgImgView = [UIImageView new];
- UIImage *image = [UIImage imageNamed:@"segmentedcontrollerbgicon"];
- UIImage *bgImage = [FLImageHelper generateThumbnailFromTop:image frame:CGSizeMake(UISCREENWIDTH, 44)];
- _segmentedBgImgView.image = bgImage;
- _segmentedBgImgView.hidden = YES;
- }
- return _segmentedBgImgView;
- }
- - (FKUIScrollView *)scrollView{
- if (_scrollView == nil) {
- _scrollView = [[FKUIScrollView alloc] init];
-
- _scrollView.pagingEnabled = YES;
- _scrollView.delegate = self;
- _scrollView.showsHorizontalScrollIndicator = NO;
- _scrollView.showsVerticalScrollIndicator = NO;
- _scrollView.translatesAutoresizingMaskIntoConstraints = NO;
- _scrollView.scrollsToTop = NO;
-
- if (@available(iOS 11.0, *)) {
- _scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
- }
- }
- return _scrollView;
- }
- - (FKRecommendController *)recommendController {
- if (!_recommendController) {
- _recommendController = [FKRecommendController new];
- }
- return _recommendController;
- }
- - (NSMutableArray *)webviewControllers {
- if (!_webviewControllers) {
- _webviewControllers = [NSMutableArray array];
- }
- return _webviewControllers;
- }
- - (FKRecommendPageViewModel *)viewModel{
- if (!_viewModel) {
- _viewModel = [[FKRecommendPageViewModel alloc]init];
- }
- return _viewModel;
- }
- - (FKBrandEntryBtn *)brandBtn {
- if (_brandBtn == nil) {
- _brandBtn = [[FKBrandEntryBtn alloc]initWithFrame:CGRectMake(0, 0, 35, 44)];
- [_brandBtn addTarget:self action:@selector(clickBrandEntryBtn) forControlEvents:UIControlEventTouchUpInside];
- }
- return _brandBtn;
- }
- @end
|