加载中
UITextField和UITextView输入字数限制

extension UIViewController : UITextViewDelegate { func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { return textVie...

2021/06/21 09:37
72
获取最顶层的ViewController

// 获取最顶层的ViewController [self getCurrentVC1]; //获取当前屏幕显示的viewcontroller - (UIViewController *)getCurrentVC1 { UIViewController *rootViewController = [self getView...

2020/01/16 17:17
187
UITextField左侧搜索图标

UIImageView *leftSearcgImgView = [[UIImageView alloc] initWithFrame:CGRectMake(30, 10, 30, 15)]; leftSearcgImgView.image = [UIImage imageNamed:@"search"]; leftSearcgImgView.cont...

2019/07/25 11:38
800
UILabel计算高度

CGSize attrStrSize = [_priceDetailLabel.text boundingRectWithSize:CGSizeMake(kScreenWidth, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeNa...

2019/04/18 11:39
80
xib Layer设置

#import "CALayer+HDCXibBorderColor.h" #import @implementation CALayer (HDCXibBorderColor) - (void)setBorderColorWithUIColor:(UIColor *)color{ self.borderColor = color.CG......

2019/04/08 11:26
308
GCD倒计时

#pragma mark - 定时器 (GCD) - (void)createTimer { //设置倒计时时间 //__block 如果修饰指针时,指针相当于弱引用,指针对指向的对象不产生引用计数的影响 __block NSInteger timeout = ...

2018/08/27 10:03
218
xib计算label高度,修改view高度

CGSize titleSize = [self.remarkLabel.text boundingRectWithSize:CGSizeMake(self.remarkLabel.frame.size.width, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@...

2018/08/14 12:50
581
UILabel复制

//UILabel内容复制 self.contentLabel.userInteractionEnabled = YES; [self.contentLabel addGestureRecognizer: [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@sele...

2018/07/11 10:23
171
多线程 NSCondition线程同步(消费者等待工厂制作完成,工厂发消息)

#import "ViewController.h" @interface ViewController () { NSCondition *_condition; } @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; //......

2018/07/09 17:55
186
多线程 NSLock 数据加锁

初始化数据锁 NSLock *lock =[NSLock alloc]init]; 数据加锁 [lock lock]; 数据解锁 [lock Unlock]; 简单的模拟窗口卖票加锁 #import "ViewController.h" @interface ViewController () { in...

2018/07/09 17:45
164
从一个TabBar点击跳转到另一个TabBar(设置)里的页面

YBPayHelperViewController *chooseVC = [[UIStoryboard storyboardWithName:@"AddUI" bundle:nil] instantiateViewControllerWithIdentifier:@"YBPayHelperViewController"]; AppDelegate *...

2018/07/09 16:51
1.8K

没有更多内容

加载失败,请刷新页面

返回顶部
顶部