14. 核心动画
来源:互联网 发布:如何雇佣网络水军 编辑:程序博客网 时间:2024/04/27 09:35
- Storyboard和xib默认是归档在程序中,当使用的时候需要先解档。
- storyboard的本质是xib
- Nstimer通常是每隔一秒以上调用某一个方法的时候使用
- CADisplayLink 他可以调用一秒钟调用60次
- CADisplayLink *display = [CADsiplayLink displayLinkWithTarget:self selector:@selector(setNeedsDisplay)];
- UI层次只有一条线程 图片轮播器只有一条线程
- 上下文保存线条的属性和具体
- C语言在ocnil在c传NULL
- arc是编译器特性,是在对应的位置添加retainrelease,autoRelease。
- Analyze是上线的时候,我们需要进行内存检测。
- 两步合一步CGContextStrokeRect(ctx, CGRectMake(100, 100, 100, 50));
- UIButton *btn = [uibutton buttonwithtype];
- UIGraphicsBeginImageContextWithOptions(CGSize size, 不透明 == YES ,是否被压缩 0标示不压缩);
- NSArray/NSDictionary/NSString/NSData
- 图片要写入文件要转成2进制
- 类方法一般比对象方法快方法中没有访问成员变量的时候就可以使用类方法
- 抽取工具类方法 要找对应的类 可以写Extension或者Help
- 截屏
- 保存到相册中就不需要转成2进制
- UIImageWriteToSavedPhotosAlbum(clipImage, self, @selector(这个点进去有的))
- 三大事件触摸事件加速计事件 远程控制事件
- UIApplication UIVIEWcONTROLLER uivgIEW都继承自UIResponder都能处理事件
- touchesBegan touchesMoves touchesEnded touchesCancles
- motionBeganmotionEndedmotionCancelled
- 点击次数tabCount 触摸了多少秒timestamp
- Nsset存储无序的不同的对象
- 一次触摸事件获取的手指是一样的
- 获取当前触摸点的位置 CGPointcurrentPoint = [touch locationInView:self];
他就会调用 -(instancetype)initWithCoder:(NSCoder *)aDecoder{}
然后就会转换成代码
awakeFromNib这个事加载xib的时候调用先解档再调用这个
[Display addToRunLoop:[NSRunLoop mainRunLoop] forMode:]
CGMutablePathpath = CGPathCreateMutable();
CGPathMoveToPoint (path, NULL, 100, 100);
CGPathAddLineToPoint(path, NULL, 200, 300);
CGContextAddPath(ctx, path);
不过这是针对oc对象,智能管理oc对象的内存
如果是c语言需要手动管理内存
只要在c中出现create, copy, retain,都需要释放内存
CGPathRealease(path);corefundation也可以使用CFRelease;
CGFloat compressionQuality:标示图片质量,压缩值
NSData *imageData = [UIImageJPEGRepresentation(image, 压缩至)
NSData *imageData = UIImagePNGRepresentation(image);
[imageData writeToFile:@""可以拖文件夹 atomically:YES];
UIGraphicBeginImageContext(self.view.frame.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()]
UIImage *clipImage = UIGraphicsGetImageFromCurrentImageContext();
UIgraphicsEndImageContext();
NSData *clipsImageData = UIImagePnGRepresentation(clipImage);
[clipImageData writeToFile:@"/User --- "automically: YES];
在这个方法中判断if(error)如果是真就保存失败
NSArry存储有序的可以重复的对象
NSDictionary:用键值对来存储数据
获取上一次的触摸点的位置[touch previousLocationInView:self];
- 14. 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- 核心动画
- Velocity布局详解(二)
- MSBuild入门
- localhost和127.0.0.1的区别
- 【poj 2531】Network Saboteur 题意&题解&代码(C++)
- MVC设计模式
- 14. 核心动画
- CSDN与博客园博文基本同步
- Android studio导入第三方项目(以Volley为例)
- linux环境编程之 fork() || fork()
- [疯狂Java]TCP:TCP协议的概念、Socket通信、超时等待
- 15.UIDynamic 物理引擎
- 学习google编程风格
- 使用include标签引入布局
- 精华阅读第 9 期 |滴滴出行 iOS 客户端架构演进之路