上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 103 下一页
摘要: 简介: 在IOS9.2官方文档中Attributes的描述如下,简单明了: Attributes provide more information about a declaration or type. There are two kinds of attributes in Swift, tho 阅读全文
posted @ 2019-02-14 18:40 zzfx 阅读(682) 评论(0) 推荐(0)
摘要: oc的静态函数与类函数不同; 1、静态函数与c++中表现一致,只在模块内部可见; 2、静态函数内部没有self变量; 3、静态函数不参与动态派发;没有在函数列表里;是静态绑定的; @implementation PXGooooogo + (BOOL) testEgo{ NSLog(@"eeeeee" 阅读全文
posted @ 2019-02-14 17:28 zzfx 阅读(1367) 评论(0) 推荐(0)
摘要: 数据结构的表现形式即为变量;变量是算法的重要组成部分;算法的表现形式即为变量的维护; 算法中的变量分为几种:输入、输出和临时变量; 输入和输出是算法的基础变量;简单的算法只需要这两种变量就可以; 临时变量是算法中的辅助变量;其表现形式有三种: 1、上下文变量,用于保存算法状态切换时的上下文;这个在链 阅读全文
posted @ 2019-02-14 11:28 zzfx 阅读(323) 评论(0) 推荐(0)
摘要: 八大算法:枚举、递推、递归、分治、贪心、试探法、动态迭代和模拟算法思想。 一、枚举算法思想(暴力算法) 将问题的所有可能答案一一列举,根据判断条件判断此答案是否合适,一般用循环实现。 经典运用:百钱买百鸡、填写运算符 二、递推算法思想 1.顺推法:从已知条件出发,逐步推算出要解决问题的方法。 2.逆 阅读全文
posted @ 2019-02-13 19:12 zzfx 阅读(2159) 评论(0) 推荐(0)
摘要: 通过哨兵参数实现,相当于nil. 1.c语言中 #import <stdio.h> #import <stdarg.h> int addemUp(int firstNum,...) { va_list args;//指向参数的指针 int sum = firstNum; int number; va 阅读全文
posted @ 2019-02-13 17:16 zzfx 阅读(770) 评论(0) 推荐(0)
摘要: HOOK:面向函数,解决函数调用拦截与替换的问题; 动态代理:面向对象,解决对象的动态替换问题; 动态代理的实现方案: 1、经典代理机制; 2、子类化机制;oc语言的isa替换是这额解决方案的经典案例; 阅读全文
posted @ 2019-02-13 11:02 zzfx 阅读(581) 评论(0) 推荐(0)
摘要: 在Java和.Net中的AOP也是利用了这种代理模式的实现。 iOS实现的代码如下: 首先,定义一个接口, 这个接口做两件事,doSomething和doOtherThing。 被代理类需要实现这个接口(不实现其实也可以,只是设计不好,每一个类都应该实现接口或者继承自一个抽象类)。 同时,代理类也实 阅读全文
posted @ 2019-02-12 14:49 zzfx 阅读(272) 评论(0) 推荐(0)
摘要: hook与链表的节点操作有相似之处; 链表的前后顺序相当于程序的执行流; 对链表节点的替换或插入相当于hook技术; 1、替换:用新的节点替换原来的节点; 2、前插入: 3、后插入; 修改原来的结构。 阅读全文
posted @ 2019-02-11 17:50 zzfx 阅读(337) 评论(0) 推荐(0)
摘要: 动画的组合; caanimationgroup:同一个layer; CATransaction:不同layer; In Core Animation, transactions are a way to group multiple animation-related changes togethe 阅读全文
posted @ 2019-02-11 16:45 zzfx 阅读(598) 评论(0) 推荐(0)
摘要: CALayer 拥有 mask 属性,Apple 的官方解释如下: An optional layer whose alpha channel is used to mask the layer’s content. The layer’s alpha channel determines how 阅读全文
posted @ 2019-02-01 14:41 zzfx 阅读(614) 评论(0) 推荐(0)
摘要: 数据结构与算法的观点: 数据结构:视图序列; 算法:播放控制; 动画是采用连续播放静止图像的方法产生物体运动的效果。 动画是视图(图像)序列的播放; 动画的内容:图片 包含图片的生成; 图片的处理:合成、光学、几何操作等; 动画的控制:动画的播放控制 播放的基本单元是帧; 播放是将图片序列在时间轴上 阅读全文
posted @ 2019-02-01 13:05 zzfx 阅读(251) 评论(0) 推荐(0)
摘要: A blog about Core Animation and other iOS graphics frameworks. https://www.calayer.com/ 阅读全文
posted @ 2019-01-31 19:32 zzfx 阅读(124) 评论(0) 推荐(0)
摘要: 矢量图、gpu直接使用、占用内存小 What Shape Layers Are Shape layers are layers capable of defining shapes as vectors. Because they’re defined as vectors, they are re 阅读全文
posted @ 2019-01-31 19:30 zzfx 阅读(196) 评论(0) 推荐(0)
摘要: 例如:我们新建一个SubLayer类继承自CALayer,则在SubLayer.m中重写此方法。如下: + (id)defaultValueForKey:(NSString *)key { if ([key isEqualToString:@"backgroundColor"]) { return 阅读全文
posted @ 2019-01-31 18:23 zzfx 阅读(315) 评论(0) 推荐(0)
摘要: Transactions are CoreAnimation's mechanism for batching multiple layer- tree operations into atomic updates to the render tree. Every modification to 阅读全文
posted @ 2019-01-31 17:44 zzfx 阅读(982) 评论(0) 推荐(0)
摘要: 动画的定义:视图+时间+空间+速度 视图信息的时空变换; 视图组的按时间逐帧展示; Core Animation 类的继承关系图 Core Animation 类的继承关系图 各类常用属性 CAMediaTiming:CALayer和Core Animation都实现了这个协议,它模拟了一个定时系统 阅读全文
posted @ 2019-01-31 16:51 zzfx 阅读(335) 评论(0) 推荐(0)
摘要: 1、语言与系统; 2、架构与机制; 3、性能:cpu、gpu、io、缓存、内存;性能监测工具; 4、知名开源库; 阅读全文
posted @ 2019-01-31 16:37 zzfx 阅读(301) 评论(0) 推荐(0)
摘要: 理解的核心是理清:application、render server、opengl、core animation、gpu、显示器的关系。 本文将从 OpenGL 的角度结合 Apple 官方给出的部分资料,介绍 iOS Rendering Process 的概念及其整个底层渲染管道的各个流程。 相信 阅读全文
posted @ 2019-01-30 21:41 zzfx 阅读(556) 评论(0) 推荐(0)
摘要: Core Animation Pipeline 流水线 在 iOS上,动画和视图的渲染其实是在另外一个进程做的(下面我们叫这个进程 render server),在 iOS 5 以前这个进程叫 SpringBoard,在 iOS 6 之后叫 BackBoard。 显示逻辑 1、CoreAnimati 阅读全文
posted @ 2019-01-30 21:09 zzfx 阅读(1512) 评论(0) 推荐(0)
摘要: - (void)stroke Draws a line along the receiver’s path using the current drawing properties. - (void)fill Paints the region enclosed by the receiver’s 阅读全文
posted @ 2019-01-30 17:21 zzfx 阅读(412) 评论(0) 推荐(0)
上一页 1 ··· 41 42 43 44 45 46 47 48 49 ··· 103 下一页