New file |
| | |
| | | // |
| | | // LMJHomeViewController.m |
| | | // PLMMPRJK |
| | | // |
| | | // Created by NJHu on 2017/3/29. |
| | | // Copyright © 2017年 GoMePrjk. All rights reserved. |
| | | // |
| | | |
| | | #import "LMJHomeViewController.h" |
| | | #import "LMJWebViewController.h" |
| | | //#import "LMJLiftCycleViewController.h" |
| | | //#import "LMJRunTimeViewController.h" |
| | | //#import "LMJNSThreadViewController.h" |
| | | //#import "LMJGCDViewController.h" |
| | | //#import "LMJNSOperationViewController.h" |
| | | //#import "LMJLockViewController.h" |
| | | //#import "LMJBlockLoopViewController.h" |
| | | //#import "LMJRunLoopViewController.h" |
| | | //#import "LMJDynamicViewController.h" |
| | | //#import "LMJCoreAnimationViewController.h" |
| | | //#import "LMJDrawRectViewController.h" |
| | | //#import "LMJWebImagesCacheViewController.h" |
| | | |
| | | @interface LMJHomeViewController () |
| | | |
| | | @end |
| | | |
| | | @implementation LMJHomeViewController |
| | | |
| | | #pragma mark viewController生命周期 |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | |
| | | UIEdgeInsets edgeInsets = self.tableView.contentInset; |
| | | edgeInsets.bottom += self.tabBarController.tabBar.lmj_height; |
| | | self.tableView.contentInset = edgeInsets; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | #pragma mark - LMJNavUIBaseViewControllerDataSource |
| | | //- (BOOL)navUIBaseViewControllerIsNeedNavBar:(LMJNavUIBaseViewController *)navUIBaseViewController |
| | | //{ |
| | | // return YES; |
| | | //} |
| | | |
| | | |
| | | |
| | | #pragma mark - DataSource |
| | | /**头部标题*/ |
| | | - (NSMutableAttributedString*)lmjNavigationBarTitle:(LMJNavigationBar *)navigationBar |
| | | { |
| | | return [self changeTitle:@"预演 功能列表"]; |
| | | } |
| | | |
| | | /** 背景图片 */ |
| | | //- (UIImage *)lmjNavigationBarBackgroundImage:(LMJNavigationBar *)navigationBar |
| | | //{ |
| | | // |
| | | //} |
| | | |
| | | /** 背景色 */ |
| | | //- (UIColor *)lmjNavigationBackgroundColor:(LMJNavigationBar *)navigationBar |
| | | //{ |
| | | // |
| | | //} |
| | | |
| | | /** 是否隐藏底部黑线 */ |
| | | //- (BOOL)lmjNavigationIsHideBottomLine:(LMJNavigationBar *)navigationBar |
| | | //{ |
| | | // return NO; |
| | | //} |
| | | |
| | | /** 导航条的高度 */ |
| | | //- (CGFloat)lmjNavigationHeight:(LMJNavigationBar *)navigationBar |
| | | //{ |
| | | // |
| | | //} |
| | | |
| | | |
| | | /** 导航条的左边的 view */ |
| | | //- (UIView *)lmjNavigationBarLeftView:(LMJNavigationBar *)navigationBar |
| | | //{ |
| | | // |
| | | //} |
| | | /** 导航条右边的 view */ |
| | | //- (UIView *)lmjNavigationBarRightView:(LMJNavigationBar *)navigationBar |
| | | //{ |
| | | // |
| | | //} |
| | | /** 导航条中间的 View */ |
| | | //- (UIView *)lmjNavigationBarTitleView:(LMJNavigationBar *)navigationBar |
| | | //{ |
| | | // |
| | | //} |
| | | /** 导航条左边的按钮 */ |
| | | - (UIImage *)lmjNavigationBarLeftButtonImage:(UIButton *)leftButton navigationBar:(LMJNavigationBar *)navigationBar |
| | | { |
| | | [leftButton setTitle:@"😁" forState:UIControlStateNormal]; |
| | | return nil; |
| | | } |
| | | /** 导航条右边的按钮 */ |
| | | - (UIImage *)lmjNavigationBarRightButtonImage:(UIButton *)rightButton navigationBar:(LMJNavigationBar *)navigationBar |
| | | { |
| | | [rightButton setTitle:@"点个赞吧😁" forState:UIControlStateNormal]; |
| | | |
| | | [rightButton setTitleColor:[UIColor RandomColor] forState:UIControlStateNormal]; |
| | | [rightButton sizeToFit]; |
| | | rightButton.lmj_width += 10; |
| | | rightButton.height = 44; |
| | | return nil; |
| | | } |
| | | |
| | | |
| | | |
| | | #pragma mark - Delegate |
| | | /** 左边的按钮的点击 */ |
| | | -(void)leftButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar |
| | | { |
| | | |
| | | } |
| | | /** 右边的按钮的点击 */ |
| | | -(void)rightButtonEvent:(UIButton *)sender navigationBar:(LMJNavigationBar *)navigationBar |
| | | { |
| | | LMJWebViewController *ac = [LMJWebViewController new]; |
| | | ac.gotoURL = @"https://github.com/NJHu/iOSProject"; |
| | | |
| | | [self.navigationController pushViewController:ac animated:YES]; |
| | | NSLog(@"%s", __func__); |
| | | } |
| | | /** 中间如果是 label 就会有点击 */ |
| | | -(void)titleClickEvent:(UILabel *)sender navigationBar:(LMJNavigationBar *)navigationBar |
| | | { |
| | | NSLog(@"%s", __func__); |
| | | } |
| | | |
| | | |
| | | #pragma mark 自定义代码 |
| | | |
| | | -(NSMutableAttributedString *)changeTitle:(NSString *)curTitle |
| | | { |
| | | NSMutableAttributedString *title = [[NSMutableAttributedString alloc] initWithString:curTitle ?: @""]; |
| | | |
| | | [title addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(0, title.length)]; |
| | | |
| | | [title addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(0, title.length)]; |
| | | |
| | | return title; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @end |
| | | |
| | | |
| | | |
| | | |