iOS开发中一些第三方库使用记录

自定义导航栏 EasyNavigation的使用

初始化

#pragma mark - 设置导航栏
- (void)setNavgtionConfig {
    
    EasyNavigationOptions *options = [EasyNavigationOptions shareInstance];
    options.titleColor = [UIColor whiteColor];
    options.buttonTitleFont = [UIFont systemFontOfSize:18];
    options.navBackgroundImage = [ISGTools createImageWithColor:[UIColor whiteColor]];
    options.buttonTitleColor = [UIColor whiteColor];
    
    // 设置系统返回按钮为样式
    options.navigationBackButtonImage = [UIImage imageNamed:@"nav_back"];
}

自定义导航栏

// 设置返回按钮
[self.navigationView.navigationBackButton setImage:[UIImage imageNamed:@"nav_back"] forState:UIControlStateNormal] ;

// 设置标题
[self.navigationView setTitle:@""];

// 设置标题颜色
self.navigationView.titleLabel.textColor = [UIColor colorWithHexString:kGreen_HC];

// 隐藏分割线
self.navigationView.lineView.hidden = YES;

// 添加右侧按钮
[self.navigationView addRightButtonWithImage:[UIImage imageNamed:@"tip_Nav"] clickCallBack:^(UIView *view) {
       
    }];

// 自定义返回按钮点击事件    
self.navigationView.navigationBackButtonCallback = ^(UIView *view) {

    };   
    

滑动视图改变导航栏

tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
[self.navigationView setNavigationBackgroundAlpha:0.0];
[self.navigationView navigationAlphaSlowChangeWithScrollow:tableView start:0 end:184];
    
    
#pragma mark - —————————————————————UIScrollView Delegate—————————————————————
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
    CGFloat offsetY = scrollView.contentOffset.y;
    if (offsetY >= 184) {
    
    }else {
        
    }
}

多功能TextView BATextView的使用

限制字数

// 设置代理
[_textView ba_textViewWithDelegate:_textView];

[self.textView ba_textView_wordLimitWithMaxWordLimitNumber:80 block:^(NSString *current_text) {
        
        dispatch_async(dispatch_get_main_queue(), ^{
            weakSelf."字数限制Label".text = [NSString stringWithFormat:@"%ld/%ld", (long)current_text.length, (long)weakSelf.textView.ba_maxWordLimitNumber];
            [weakSelf.view setNeedsLayout];
        });
    }];

限制最大以及最小宽度

 [self.remakeTextView ba_textView_autoLayoutWithMaxHeight:CGFLOAT_MAX minHeight:104 block:^(CGFloat current_textViewHeight) {

    }];
    

你可能感兴趣的:(iOS开发中一些第三方库使用记录)