功能
载你走
念念不忘,必有回响
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
安装Homebrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"原创 2022-02-24 00:05:28 · 177 阅读 · 0 评论 -
iOS. 同一Label内文字不一样颜色
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"已查看%@/%@",self.dataM.view_num,self.dataM.total_num]]; NSRange range = [[str strin...原创 2019-12-28 16:47:24 · 201 阅读 · 0 评论 -
iOS. 结合Sourcetree 将带代码上传到 GitLab仓库
首先在GitLab 一、新建一个项目 然后添加好项目成员二、打开SourceTree 从Url克隆,把gitLab创建好的项目的链接拿过来填进去三、新建一个文件夹,把地址设为这个文件夹四、把项目复制进这个文件夹五、提交六、推送End 大功告成,此时代码已经上传到gitLab仓库,去gitLab项目页查看就会看到提交记录...原创 2019-11-26 13:28:10 · 692 阅读 · 0 评论 -
Xcode11添加代码块
原创 2019-11-06 11:24:06 · 3773 阅读 · 0 评论 -
iOS 通知传值
NSDictionary *dict = @{ @"data":weakSelf.sweepDataArr, @"image":weakSelf.dataImgage }; [[NSNotificationCente...原创 2019-11-05 16:10:53 · 209 阅读 · 0 评论 -
iOS 修改WKwebView字体大小
一个代理方法就搞定了 _wkWebView.navigationDelegate = self;- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{ [ webView evaluateJavaScript:@"document.getEleme...原创 2019-10-25 14:15:04 · 3050 阅读 · 0 评论 -
iOS 自定义键盘顶部视图 UIToolBar InputAccessoryView
逻辑就是 要保证在键盘弹出来的时候自定义的View要在键盘的上方,在键盘隐藏的时候自定义的View也隐藏那么需要监听到键盘的弹出和隐藏首先呢写两个通知,来分别通知键盘的弹出和隐藏,我们在对其进行更改坐标添加动画等操作[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changetoolBa...原创 2019-09-25 09:40:42 · 3688 阅读 · 0 评论 -
iOS View跳转到ViewController ———————— 代理的使用(干货)
在View中对Button的触发事件或者didSelectRow都无法直接进行跳转到ViewController;在这里就用代理来实现1.首先在View的.h文件中@protocol RecognitionResultViewDelegate <NSObject>-(void)GoAskQuestionPushVC;@optional@end@interfa...原创 2019-09-19 16:26:51 · 1157 阅读 · 0 评论 -
ios Cell中的按钮实现单选
首先定义一个变量来记录按钮的状态@property (assign, nonatomic) NSIndexPath *selIndex;//单选,当前选中的行- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ NSInteger ...原创 2019-09-09 09:04:39 · 1160 阅读 · 0 评论 -
iOS 防止按钮重复点击简单快捷的方法两行代搞定
这个方法是利用了button的enabled的属性去实现防止用户多次点击按钮多次请求数据-(void)ButtonClick:(uibutton *)sender{}sender.enabled = NO; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), disp...原创 2019-02-17 18:53:25 · 341 阅读 · 0 评论 -
IOS 强制让APP退出,非闪退非崩溃;还有用代码达到点击Home键退出的功能效果
强制让App直接退出(非闪退,非崩溃)- (void)exitApplication { UIWindow *window = [AppDelegate new].window; [UIView animateWithDuration:1.0f animations:^{ window.alpha = 0; } completion:^(B...原创 2019-02-16 18:58:13 · 4565 阅读 · 0 评论 -
iOS 当前时间之前与当前时间之后比较
NSComparisonResult result = [localeDate compare:csDate]; if (result == NSOrderedDescending) { //在指定时间前面 过了指定时间 过期 NSLog(@"历史回放"); } else if (result == NSOrdered...原创 2019-01-19 09:59:37 · 678 阅读 · 0 评论 -
iOS 如果后台返回的数据少了字段怎么防止崩溃
self->headImgArr = [[NSMutableArray alloc]init]; for (int i = 0; i < self->myStuArr.count; i++) { StudnetList *stu = self->myStuArr[i]; ...原创 2019-01-04 14:45:38 · 525 阅读 · 0 评论 -
iOS 更改状态栏背景颜色
更改状态栏背景颜色的方法有很多种,在这说两种一、// 设置状态栏背景颜色//- (void)setStatusBarBackgroundColor:(UIColor *)color {// UIView *statusBar = [[[UIApplication sharedApplication] valueForKey:@"statusBarWindow"] valueF...原创 2019-01-03 15:45:24 · 2331 阅读 · 0 评论 -
iOS 缓存图片和取出缓存的图片
直接上代码,简单易懂,直接能用- (void)viewDidLoad { [super viewDidLoad]; UIImage *currentImage = [UIImage imageNamed:@"2C1E53247E58800A65DC8069F215A519"]; [self saveImage:currentImage]; ...原创 2018-12-26 14:47:14 · 2050 阅读 · 2 评论
分享