摘要:
//动画为沿y轴旋转 let animation = CABasicAnimation(keyPath: "transform.rotation.y") animation.fromValue = 0 animation.toValue = Double.pi * 2 animation.repeatCount = ... 阅读全文
随笔档案-2018年11月
UITextField 限制输入长度
2018-11-28 11:56 by 法子, 218 阅读, 收藏, 编辑
摘要:
static int MaxLength = 16; - (void)viewDidLoad { [super viewDidLoad]; [self.myTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChange... 阅读全文
Core Animation放大缩小;CAKeyframeAnimation
2018-11-26 19:41 by 法子, 1631 阅读, 收藏, 编辑
摘要:
先放大1.2倍,再还原;两段动画时间比例为7:3;总时间0.4秒。整体效果现快后慢。 阅读全文
Storyboard返回到指定视图 Exit
2018-11-26 10:54 by 法子, 734 阅读, 收藏, 编辑
摘要:
如果经过了多次多种跳转,想回到指定视图,用pop或dismiss就很难实现。Storybord里的Exit可以实现这个功能。 比如FirstViewController视图push(show)到SecondViewController,SecondViewController再Present Mod 阅读全文
iPhone、iPad的图片可以同一个名字
2018-11-22 16:16 by 法子, 359 阅读, 收藏, 编辑
摘要:
在Assets.xcassets里,选择图片,勾选iPad,就可以把iPad的图片拖进去。 阅读全文
KeyboardNotificationViewController
2018-11-22 16:11 by 法子, 318 阅读, 收藏, 编辑
摘要:
GitHub地址:https://github.com/liuyongfa/KeyboardNotificationViewController.git 继承KeyboardNotificationViewController,并且重写函数 返回最底部不想被键盘覆盖的控件。就可以实现view跟随键盘 阅读全文
Preprocessor Macros区分target
2018-11-21 15:17 by 法子, 339 阅读, 收藏, 编辑
摘要:
原文:https://blog.csdn.net/apple_app/article/details/38663367 给不同的target的Build Settings->Preprocessor Macros里添加不同的宏, 然后 阅读全文
UIAlertController Extention
2018-11-21 11:59 by 法子, 295 阅读, 收藏, 编辑
摘要:
GitHub地址: 一、Object-C 调用: UIAlertController+LYFExtention.h UIAlertController+LYFExtention.m 二、Swift 调用: UIAlertControllerExtension.swift 阅读全文
convertRect, convertPoint
2018-11-21 10:09 by 法子, 436 阅读, 收藏, 编辑
摘要:
参考文章:http://www.cnblogs.com/chenyg32/p/4800420.html 想获取在其他控件里的button相对与整个self.view的frame 想获取(相对于屏幕的坐标的)触摸点相对于某个tableView的坐标 阅读全文
UIViewAnimationOptions
2018-11-16 10:50 by 法子, 968 阅读, 收藏, 编辑
摘要:
有时候想用UIview写出不是匀速的动画, 参数options是UIViewAnimationOptions类型,包含很多选项,其中 UIViewAnimationOptionCurveEaseInOut:开始和结束慢,中间快 Specify an ease-in ease-out curve, w 阅读全文
iOS App版本号compare
2018-11-16 10:37 by 法子, 338 阅读, 收藏, 编辑
摘要:
参考原文:https://www.jianshu.com/p/1dd7745f5ee4 NSStringCompareOptions里有个NSNumericSearch /* Added in 10.2; Numbers within strings are compared using numer 阅读全文
Xcode10 创建 framework (Objective-c),bundle(包含xib、image),第三方库,使用报错
2018-11-06 19:42 by 法子, 2795 阅读, 收藏, 编辑
摘要:
一、生成部分 参考:http://www.cocoachina.com/ios/20150127/11022.html https://www.jianshu.com/p/87dbf57cfe4a (里面的脚本有问题,我参考另一篇文章做了修改) https://www.jianshu.com/p/e 阅读全文