ios_core_animation_advanced_techniques's People
Forkers
showhilllee mskobe sdbruli dkmeteor stonerzju code1303009 ydj mtbug pflnh hrt941009 wdxgtsh ilovefeng derekpan camila-tw doudou2012 zwcshy peterdocter tiger8888 thetiso blessneo flyhawk007 xuehaiwuya11 aduir dorayo rensnail zilaiyedaren sizhupo imwcl wenquan0hf kb100824 valie huaiyongtai clamppost wang-jun-coder shangzhehao evilino zx19 lbingrun dormitory219 samirchen shenyuan000 mstarlogo loirou akfisher liangdahong z624821876 zysss 937447974 jackguofranklin xuvw zerody justcv aloneee qifeipan wufd ekkog hhlm zht415 kukumalucn ygx2011 yufeiskyer ludy520 cocoaniu gkcheng lixufeng1992 lgystoic gibsion w99wen123dff jiangbencoder foolish-boy quentin996007 welcommand aya-wang lefex yuanyuandog wfics kaich xiabob coderclwoo action121 zljkevin kasign beijinanji90 jimbaby leixiang1986 liuniuliuniu jiu0929 chaserr liuyongxin nbhhcty igerry haiyuansun hbulixu codelee321 coderhbl kemchenj hunterhuu tpyphone justloveben ly1040558989ios_core_animation_advanced_techniques's Issues
4.6 组透明
按钮和表情都是白色背景
"表情"应为标签
Chapter 5.1放射变换
代码的注释错了
- (void)viewDidLoad { [super viewDidLoad]; //create a new transform CGAffineTransform transform = CGAffineTransformIdentity; //scale by 50% transform = CGAffineTransformScale(transform, 0.5, 0.5); //rotate by 30 degrees transform = CGAffineTransformRotate(transform, M_PI / 180.0 * 30.0); //translate by 200 points transform = CGAffineTransformTranslate(transform, 200, 0); //apply transform to layer self.layerView.layer.affineTransform = transform; }
应该为
- (void)viewDidLoad { [super viewDidLoad]; CGAffineTransform transform = CGAffineTransformIdentity;//create a new transform transform = CGAffineTransformScale(transform, 0.5, 0.5); //scale by 50% transform = CGAffineTransformRotate(transform, M_PI / 180.0 * 30.0); //rotate by 30 degrees transform = CGAffineTransformTranslate(transform, 200, 0);//translate by 200 points //apply transform to layer self.layerView.layer.affineTransform = transform; }
你好 固体变换的一章重复了3d变换一章的内容
rt
3D变换,关于CATransform3D中m34的位置有误
CATransform3D中m34在矩阵的实际位置应该是第三行第四列,而不是图5.9中的第四行第三列
已为本书整合官方源码和素材
已为本书整合官方源码和素材,仓库地址 https://github.com/cocos543/iOS-Core-Animation-Advanced-Techniques-Resource
欢迎Star
41页图3.3附近关于anchorPoint的描述和Xcode注释有悖。
41页图3.3附近关于anchorPoint的描述
Xcode8关于anchorPoint的注释
/* Defines the anchor point of the layer's bounds rect, as a point in
* normalized layer coordinates - '(0, 0)' is the bottom left corner of
* the bounds rect, '(1, 1)' is the top right corner. Defaults to
* '(0.5, 0.5)', i.e. the center of the bounds rect. Animatable. */
@Property CGPoint anchorPoint;
到底哪里出了问题^_^
在gitBook的书上上无法看到13张的图13_2、13_3、13_4图片
在gitBook上无法看到13章的图13_2、13_3、13_4图片
第八章 显式动画章节缺失了开头一部分(基础动画)
第八章显式动画直接从属性动画的CAAnimationDelegate开始翻译,缺失了属性动画的基础动画块的翻译
关于gitbook电子书
在下载EPUB的电子书时,有很多图片缺失~
下载的PDF中代码不能完整预览
这个翻译很不错,但就是代码太长的时候虽然有滚动条但是没办法拖动,代码也就没办法预览到。
Chapter 3.1 Hit Testing 中 关于 hitTest 与 zPosition的论述经过测试有误
注意当调用图层的-hitTest:方法时,测算的顺序严格依赖于图层树当中的图层顺序(和UIView处理事件类似)。之前提到的zPosition属性可以明显改变屏幕上图层的顺序,但不能改变事件传递的顺序。
这意味着如果改变了图层的z轴顺序,你会发现将不能够检测到最前方的视图点击事件,这是因为被另一个图层遮盖住了,虽然它的zPosition值较小,但是在图层树中的顺序靠前。我们将在第五章详细讨论这个问题。
论述说 改变zPosition值不会改变 hitTest:
方法的返回值,但是经过如下示例代码测试,发现改变zPosition值会改变 hitTest:
方法的返回值。
示例代码:
- (void)addSomeLayers{
self.tempLayer = [CALayer layer];
self.tempLayer.backgroundColor = [UIColor blueColor].CGColor;
self.tempLayer.frame = CGRectMake(100, 100, 200, 200);
[self.view.layer addSublayer:self.tempLayer];
self.redLayer = [CALayer layer];
self.redLayer.backgroundColor = [UIColor redColor].CGColor;
self.redLayer.frame = CGRectMake(50, 50, 50, 50);
[self.tempLayer addSublayer:self.redLayer];
self.yellowLayer = [CALayer layer];
self.yellowLayer.backgroundColor = [UIColor yellowColor].CGColor;
self.yellowLayer.frame = CGRectMake(75, 75, 100, 100);
[self.tempLayer addSublayer:self.yellowLayer];
self.redLayer.zPosition = 1;
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
UITouch *anyTouch = [touches anyObject];
CGPoint point = [anyTouch locationInView:self.view];
CALayer *layer = [self.view.layer hitTest:point];
if (layer == self.tempLayer) {
NSLog(@"touch blue layer");
}
else if (layer == self.view.layer){
NSLog(@"touch self.view.layer");
}
else if(layer == self.redLayer){
NSLog(@"touch red layer");
}
else if(layer == self.yellowLayer){
NSLog(@"touch yellow layer");
}
}
在self.tempLayer
上先后添加了self.redLayer
和self.yellowLayer
,图层树中的顺序应该是self.yellowLayer
在最上面,但是通过self.redLayer.zPosition = 1;
改变self.redLayer
的显示顺序后,hitTest:
方法返回了self.redLayer
P48 第二行翻译错误
第二行原文:Note that there is no depth property to complement the bounds width and height.
翻译成了更深的属性
。原文值的是“厚度”概念,类似于Thickness,说明layer 是扁平的,在z轴方向没有“纵深”。
P118 CATextLayer 第一行
应翻译成:用户界面不能仅由图片构成
《仿射变换》一节里的矩阵行列写反了
“因此,通常会用3×3(而不是2×3)的矩阵来做二维变换,你可能会见到3行2列格式的矩阵,这是所谓的以列为主的格式,图5.1所示的是以行为主的格式,只要能保持一致,用哪种格式都无所谓。”
这个,括号里面应该是“3x2”。
8.3处 CATransition目前已经支持filter了
这本书还会更新吗?
请问有办法可以拿到书中图片资源吗?
请问有办法可以拿到书中图片资源吗
9.2层级关系
这一张内容为空,在github中的md文件也只有目录。
清单8.4 使用KVC对动画打标签 代码有问题
我仔细看了下代码,按照那里的写法的确能够成功执行。但是我发现
- (void)setAngle:(CGFloat)angle forHand:(UIView *)handView animated:(BOOL)animated
{
//generate transform
CATransform3D transform = CATransform3DMakeRotation(angle, 0, 0, 1);
if (animated) {
//create transform animation
CABasicAnimation *animation = [CABasicAnimation animation];
[self updateHandsAnimated:NO];
animation.keyPath = @"transform";
animation.toValue = [NSValue valueWithCATransform3D:transform];
animation.duration = 0.5;
animation.delegate = self;
[animation setValue:handView forKey:@"handView"];
[handView.layer addAnimation:animation forKey:nil];
} else {
//set transform directly
handView.layer.transform = transform;
}
}
这段代码里面 修改成
- (void)setAngle:(CGFloat)angle forHand:(UIView *)handView animated:(BOOL)animated
{
//generate transform
CATransform3D transform = CATransform3DMakeRotation(angle, 0, 0, 1);
handView.layer.transform = transform;
}
一样能成功执行,因为以上代码主要的作用只是做了一个transform转换,并没有达到CABasicAnimation的目的。我觉得其实作者想要实现的效果应该是
- (void)setAngle:(CGFloat )angle forHand:(UIImageView *)handView animated:(BOOL)animated
{
CATransform3D transform = CATransform3DMakeRotation(angle, 0, 0, 1);
if (animated) {
CABasicAnimation *animation = [CABasicAnimation animation];
animation.keyPath = @"transform";
animation.toValue = [NSValue valueWithCATransform3D:transform];
animation.duration = 0.5;
animation.fillMode = kCAFillModeForwards;
animation.removedOnCompletion = NO;
[handView.layer addAnimation:animation forKey:nil];
}
else
{
handView.layer.transform = transform;
}
}
作者可以参考下
"固体对象"部分内容重复了"3D变换"的内容
第5章变换 5.3 “固体对象”的部分内容重复了 5.2 “3D变换”的内容,有空修正一下下吧~
大神可以提供一下书上的例子的源码吗?
图层几何学--》锚点
图层几何学--》锚点 没有内容。我下载了pdf和epub都没有。在线的也没有(或者是不是章节对应有问题)
7.1事务章节代码错误
Chapter8.1
错别字
文章结尾处"已近",是不是应为“已经”
10.2自定义缓冲函数代码
直接用书上的代码,取得的两个点坐标不对,需改成如下:
float p1[2];
float p2[2];
[func getControlPointAtIndex:1 values:(float *)&p1];
[func getControlPointAtIndex:2 values:(float *)&p2];
CGPoint point1 = CGPointMake(p1[0], p1[1]);
CGPoint point2 = CGPointMake(p2[0], p2[1]);
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx;有创建寄宿图吗?
你寄宿图那章说调用-drawRect:和- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx;都会创建寄宿图。我测试了一下在UIView(frame特别大)的时候重写-drawRect:内存急剧飙升确实应该产生了寄宿图。但是在测试layer的时候调用了- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx;内存并没有上升很多啊,感觉好像没有创建寄宿图的样子。
3D变换章节代码疑问
3D变换中,透视部分为什么采用CATransform3DMakeRotation函数没有作用,也设置了m34。但换成CATransform3Drotate属性则有作用
contentsRect小节
Figure 2.6 A custom contentsRect (left) and the displayed contents (right) 这个图片说明的翻译:图2.6 一个自定义的contentsRect(左)和之后(配置之后)显示的内容
Chipmunk 引入之后,项目编译就报错了.
报错信息如下,处理了很久不知道是什么原因,希望能给与解答.谢谢.
Undefined symbols for architecture arm64:
"_cpSpaceStep", referenced from:
-[ZJBKAnimationWithTimerVC stepBox:] in ZJBKAnimationWithTimerVC.o
"_cpSpaceEachShape", referenced from:
-[ZJBKAnimationWithTimerVC stepBox:] in ZJBKAnimationWithTimerVC.o
"_cpSpaceNew", referenced from:
-[ZJBKAnimationWithTimerVC p_physicalEngine] in ZJBKAnimationWithTimerVC.o
"_cpSpaceAddBody", referenced from:
-[ZJBKAnimationWithTimerVC p_physicalEngine] in ZJBKAnimationWithTimerVC.o
"_cpShapeFree", referenced from:
-[ZJCreate dealloc] in ZJCreate.o
"_cpBodyFree", referenced from:
-[ZJCreate dealloc] in ZJCreate.o
"_cpBodyActivate", referenced from:
_cpShapeSetFriction in ZJCreate.o
"_cpBodyNew", referenced from:
-[ZJCreate initWithFrame:] in ZJCreate.o
"_cpMomentForBox", referenced from:
-[ZJCreate initWithFrame:] in ZJCreate.o
"_cpPolyShapeNew", referenced from:
-[ZJCreate initWithFrame:] in ZJCreate.o
"_cpSpaceAddShape", referenced from:
-[ZJBKAnimationWithTimerVC p_physicalEngine] in ZJBKAnimationWithTimerVC.o
"_cpBodySetPos", referenced from:
-[ZJCreate initWithFrame:] in ZJCreate.o
ld: symbol(s) not found for architecture arm64
"固体对象"部分光亮和阴影部分 代码好像有问题
normal = GLKMatrix3MultiplyVector3(matrix3, normal);
计算出的结果为
(GLKVector3) normal = {
= (s = 0, t = 0, p = 0)
= (s = 0, t = 0, p = 0)
= (s = 0, t = 0, p = 0)
v = ([0] = 0, [1] = 0, [2] = 0)
}
normal = GLKVector3Normalize(normal);
计算出的结果为
(GLKVector3) normal = {
= (s = NaN, t = NaN, p = NaN)
= (s = NaN, t = NaN, p = NaN)
= (s = NaN, t = NaN, p = NaN)
v = ([0] = NaN, [1] = NaN, [2] = NaN)
}
《3D变换》一节里,矩阵行列写反了
“和CGAffineTransform类似,CATransform3D也是一个矩阵,但是和2x3的矩阵不同,CATransform3D是一个可以在3维空间内做变换的4x4的矩阵(图5.6)”
这里的“2X3”,应该是“3X2”。
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.