diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/Animation/AnimationDiff.gif b/Animation/AnimationDiff.gif new file mode 100644 index 0000000..37fbb0f Binary files /dev/null and b/Animation/AnimationDiff.gif differ diff --git a/Animation/AnimationDiffThumb.gif b/Animation/AnimationDiffThumb.gif new file mode 100644 index 0000000..5ff6351 Binary files /dev/null and b/Animation/AnimationDiffThumb.gif differ diff --git a/Animation/AnimationJump.gif b/Animation/AnimationJump.gif new file mode 100644 index 0000000..5c83db5 Binary files /dev/null and b/Animation/AnimationJump.gif differ diff --git a/Animation/ControlPanelInteractiveAnimation.gif b/Animation/ControlPanelInteractiveAnimation.gif new file mode 100644 index 0000000..640a836 Binary files /dev/null and b/Animation/ControlPanelInteractiveAnimation.gif differ diff --git a/Animation/CoreAnimationReference.png b/Animation/CoreAnimationReference.png new file mode 100644 index 0000000..1cb1746 Binary files /dev/null and b/Animation/CoreAnimationReference.png differ diff --git a/Animation/ReverseAnimation.gif b/Animation/ReverseAnimation.gif new file mode 100644 index 0000000..524fbc3 Binary files /dev/null and b/Animation/ReverseAnimation.gif differ diff --git a/Animation/ReverseControlPanel.gif b/Animation/ReverseControlPanel.gif new file mode 100644 index 0000000..c20d488 Binary files /dev/null and b/Animation/ReverseControlPanel.gif differ diff --git a/Animation/Spring.VS.EaseInOut.png b/Animation/Spring.VS.EaseInOut.png new file mode 100644 index 0000000..9b1a84b Binary files /dev/null and b/Animation/Spring.VS.EaseInOut.png differ diff --git a/Animation/iOS10AnimationNewAPI.png b/Animation/iOS10AnimationNewAPI.png new file mode 100644 index 0000000..4c986cf Binary files /dev/null and b/Animation/iOS10AnimationNewAPI.png differ diff --git a/Animation/iOS10AnimationNewAPIReference.png b/Animation/iOS10AnimationNewAPIReference.png new file mode 100644 index 0000000..1043fbf Binary files /dev/null and b/Animation/iOS10AnimationNewAPIReference.png differ diff --git a/GraphicsPerformance/Avoid Offscreen Render.png b/GraphicsPerformance/Avoid Offscreen Render.png new file mode 100644 index 0000000..867130b Binary files /dev/null and b/GraphicsPerformance/Avoid Offscreen Render.png differ diff --git a/GraphicsPerformance/Cell Apperance.png b/GraphicsPerformance/Cell Apperance.png new file mode 100644 index 0000000..4929aee Binary files /dev/null and b/GraphicsPerformance/Cell Apperance.png differ diff --git a/GraphicsPerformance/Cell Structure.png b/GraphicsPerformance/Cell Structure.png new file mode 100644 index 0000000..0be43bc Binary files /dev/null and b/GraphicsPerformance/Cell Structure.png differ diff --git a/GraphicsPerformance/Cliping and Masking.png b/GraphicsPerformance/Cliping and Masking.png new file mode 100644 index 0000000..71a4cbc Binary files /dev/null and b/GraphicsPerformance/Cliping and Masking.png differ diff --git a/GraphicsPerformance/Components Of Frame.png b/GraphicsPerformance/Components Of Frame.png new file mode 100644 index 0000000..4e4a56d Binary files /dev/null and b/GraphicsPerformance/Components Of Frame.png differ diff --git a/GraphicsPerformance/Core Animation Instruments Debug Options.png b/GraphicsPerformance/Core Animation Instruments Debug Options.png new file mode 100644 index 0000000..2639e8c Binary files /dev/null and b/GraphicsPerformance/Core Animation Instruments Debug Options.png differ diff --git a/GraphicsPerformance/Core Animation Pipeline.png b/GraphicsPerformance/Core Animation Pipeline.png new file mode 100644 index 0000000..7539828 Binary files /dev/null and b/GraphicsPerformance/Core Animation Pipeline.png differ diff --git a/GraphicsPerformance/Core Animation Three-Stage Process.png b/GraphicsPerformance/Core Animation Three-Stage Process.png new file mode 100644 index 0000000..82972bd Binary files /dev/null and b/GraphicsPerformance/Core Animation Three-Stage Process.png differ diff --git a/GraphicsPerformance/Four-Stage in Commit Transaction.png b/GraphicsPerformance/Four-Stage in Commit Transaction.png new file mode 100644 index 0000000..7f868ee Binary files /dev/null and b/GraphicsPerformance/Four-Stage in Commit Transaction.png differ diff --git a/GraphicsPerformance/GroupOpacity Condition.png b/GraphicsPerformance/GroupOpacity Condition.png new file mode 100644 index 0000000..bb80022 Binary files /dev/null and b/GraphicsPerformance/GroupOpacity Condition.png differ diff --git a/GraphicsPerformance/GroupOpacity Sample.png b/GraphicsPerformance/GroupOpacity Sample.png new file mode 100644 index 0000000..11c8739 Binary files /dev/null and b/GraphicsPerformance/GroupOpacity Sample.png differ diff --git a/GraphicsPerformance/Performance Genenal Tips.png b/GraphicsPerformance/Performance Genenal Tips.png new file mode 100644 index 0000000..db8659f Binary files /dev/null and b/GraphicsPerformance/Performance Genenal Tips.png differ diff --git a/GraphicsPerformance/Performance Investigation Mindset.png b/GraphicsPerformance/Performance Investigation Mindset.png new file mode 100644 index 0000000..9cb8d79 Binary files /dev/null and b/GraphicsPerformance/Performance Investigation Mindset.png differ diff --git a/GraphicsPerformance/Performance Investigation Twist Tool.png b/GraphicsPerformance/Performance Investigation Twist Tool.png new file mode 100644 index 0000000..f715c9b Binary files /dev/null and b/GraphicsPerformance/Performance Investigation Twist Tool.png differ diff --git a/GraphicsPerformance/Rasterization Condition.png b/GraphicsPerformance/Rasterization Condition.png new file mode 100644 index 0000000..5ea0664 Binary files /dev/null and b/GraphicsPerformance/Rasterization Condition.png differ diff --git a/GraphicsPerformance/Rasterization Use Case.png b/GraphicsPerformance/Rasterization Use Case.png new file mode 100644 index 0000000..bc53b90 Binary files /dev/null and b/GraphicsPerformance/Rasterization Use Case.png differ diff --git a/GraphicsPerformance/Relationship of UIView and CALayer.png b/GraphicsPerformance/Relationship of UIView and CALayer.png new file mode 100644 index 0000000..013164b Binary files /dev/null and b/GraphicsPerformance/Relationship of UIView and CALayer.png differ diff --git a/GraphicsPerformance/Shadow Performance Twist.png b/GraphicsPerformance/Shadow Performance Twist.png new file mode 100644 index 0000000..24d6346 Binary files /dev/null and b/GraphicsPerformance/Shadow Performance Twist.png differ diff --git a/GraphicsPerformance/Symbolic BreakPoint Trick.png b/GraphicsPerformance/Symbolic BreakPoint Trick.png new file mode 100644 index 0000000..67fec08 Binary files /dev/null and b/GraphicsPerformance/Symbolic BreakPoint Trick.png differ diff --git a/GraphicsPerformance/Transaction Collection.png b/GraphicsPerformance/Transaction Collection.png new file mode 100644 index 0000000..29b01da Binary files /dev/null and b/GraphicsPerformance/Transaction Collection.png differ diff --git a/GraphicsPerformance/Transparent Overlay.png b/GraphicsPerformance/Transparent Overlay.png new file mode 100644 index 0000000..e9ef266 Binary files /dev/null and b/GraphicsPerformance/Transparent Overlay.png differ diff --git a/GraphicsPerformance/UIImageView Structure.png b/GraphicsPerformance/UIImageView Structure.png new file mode 100644 index 0000000..e24c6c4 Binary files /dev/null and b/GraphicsPerformance/UIImageView Structure.png differ diff --git a/GraphicsPerformance/UIImageView vs. darwRect.png b/GraphicsPerformance/UIImageView vs. darwRect.png new file mode 100644 index 0000000..fe2fba9 Binary files /dev/null and b/GraphicsPerformance/UIImageView vs. darwRect.png differ diff --git "a/GraphicsPerformance/\345\211\215\345\217\260\345\234\206\350\247\222.png" "b/GraphicsPerformance/\345\211\215\345\217\260\345\234\206\350\247\222.png" new file mode 100644 index 0000000..f531eab Binary files /dev/null and "b/GraphicsPerformance/\345\211\215\345\217\260\345\234\206\350\247\222.png" differ diff --git "a/GraphicsPerformance/\345\220\216\345\217\260\345\234\206\350\247\222.png" "b/GraphicsPerformance/\345\220\216\345\217\260\345\234\206\350\247\222.png" new file mode 100644 index 0000000..ce0f537 Binary files /dev/null and "b/GraphicsPerformance/\345\220\216\345\217\260\345\234\206\350\247\222.png" differ diff --git "a/GraphicsPerformance/\345\234\206\350\247\222\345\270\247\347\216\207.png" "b/GraphicsPerformance/\345\234\206\350\247\222\345\270\247\347\216\207.png" new file mode 100644 index 0000000..88673af Binary files /dev/null and "b/GraphicsPerformance/\345\234\206\350\247\222\345\270\247\347\216\207.png" differ diff --git "a/GraphicsPerformance/\347\263\273\347\273\237\345\234\206\350\247\222.png" "b/GraphicsPerformance/\347\263\273\347\273\237\345\234\206\350\247\222.png" new file mode 100644 index 0000000..a4d59cb Binary files /dev/null and "b/GraphicsPerformance/\347\263\273\347\273\237\345\234\206\350\247\222.png" differ diff --git "a/GraphicsPerformance/\351\201\256\347\275\251.png" "b/GraphicsPerformance/\351\201\256\347\275\251.png" new file mode 100644 index 0000000..c4a4d34 Binary files /dev/null and "b/GraphicsPerformance/\351\201\256\347\275\251.png" differ diff --git a/README.md b/README.md index 2bdb813..595c5e1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,43 @@ -# Note -半年前,准备用 Github 来搭建一个博客,发现挺折腾的,当时还有两个选择,简书和 Medium,写起东西来都很舒服,但是后者的界面实在是,尽管非常简洁,都是我总是找不到焦点。 -在简书写了半年,发现简书的排版实在不合适代码,可视宽度很窄,对中英文混排的支持也很差;在 wiki 上一点发现可视宽度也很窄,估计是兼顾800X600分辨率吧,这方面 web 的进化速度和移动端没法比,不过中英文混排比简书上好很多。而且,简书的内容风格,虽然我很少看上面的东西,但每次在手机上打开,非常地标题党以及故意反趋势,不知道是不是这就是简书想要的,我反正受不了。 +*笔记内容:* -看到有人在 Github 使用 readme 和 wiki 来组织文章,排版上不再有那么多限制,树形结构足以组织好知识点了,先尝试在这里写写。 +### [Core Data 框架](https://github.com/seedante/Note/wiki/Core-Data): + +Core Data 非常复杂,笔记目前总结了以下内容: Stack, Data Type, Relationship。 + +### [Photos 框架](https://github.com/seedante/iOS-Note/wiki/Photos) + +介绍了常用 API 和一些坑。 + +### [iOS 视图控制器转场(动画)详解](https://github.com/seedante/iOS-Note/wiki/ViewController-Transition) + +详尽地解释了全部转场机制,近期也更新了 iOS 10 中新引入的 UIViewPropertyAnimator 部分,同时该类也可用于实现交互动画。 +该文也发布在唐巧前辈的「iOSDevTips」公众号。 + +### [自定义容器控制器转场](https://github.com/seedante/iOS-Note/wiki/Custom-Container-View-Controller-Transition) + +iOS 本身并不直接支持自定义容器控制器的转场,我们可以自己添加协议来实现。这个是「转场动画详解」的一部分,由于原文部分太长了,便将这个剥离出来单独成章。 + +### [视图性能优化:离屏渲染](https://github.com/seedante/iOS-Note/wiki/Mastering-Offscreen-Render) + +objccn.io 的译者将 Offscreen Render 译作「离屏渲染」真的是很传神,关于离屏渲染的概述可参考 objccn.io 的译文:[绘制像素到屏幕上](https://objccn.io/issue-3-1/),通俗易懂。在已公开的官方资料里,最早可追溯到2011年的 WWDC,此后几年的 WWDC 有关视图方面的 session,大多都介绍了如何避免离屏渲染来提升视图性能以及使用工具来检测离屏渲染。 + +能触发离屏渲染,并且使用不当时会对视图性能造成严重影响的几种效果:阴影 Shadow, 圆角 RoundedCorner,遮罩 Mask。 +这其中圆角效果最为广泛使用,今年初涌现了一大波重绘圆角的解决方案,这种方案简单粗暴,但是比较浪费内存,而且不适用于文本视图的圆角效果。实际上除了 Mask,前两种效果都有方法来避免触发离屏渲染,而且实现成本也很低。 + +离屏渲染本来是一种优化机制,但是上面几种效果触发离屏渲染后会严重影响视图性能,如何利用离屏渲染来改善视图性能?实现方法是极其简单的。 + +本文针对各种效果的优化都做了对比测试并提供了 Demo。本文也发布在唐巧前辈的「iOSDevTips」公众号。 + + +### [交互式动画](https://github.com/seedante/iOS-Note/wiki/Interactive-Animations) + +[ WWDC 2016 Session 216: Advances in UIKit Animations and Transitions ](https://developer.apple.com/videos/play/wwdc2016/216/)介绍了一个非常有意思的类`UIViewPropertyAnimator`,该类让动画与交互无缝连接。 +该类有个很好的使用场景:转场动画的交互。之前转场动画的交互有很大的局限:无法随意在动画与交互之间切换,`UIViewPropertyAnimator`消除了这个局限。 +iOS 10 在转场协议中引入了`UIViewPropertyAnimator`的相关协议,不过为了向下兼容,使得原本比较复杂的转场协议变得臃肿无比,实际上没有这个必要,我在 [iOS 视图控制器转场(动画)详解](https://github.com/seedante/iOS-Note/wiki/View-Controller-Transition-PartII#Chapter3.7) 介绍了该类带来的交互新特性,以及如何利用该类来精简转场协议。 + +转场动画中的动画和普通的 UIView Animation 和 Core Animation 并无二致,因此使用`UIViewPropertyAnimator`让普通的动画实现交互也是个很有意思的话题。这里的文章是两篇文章的合集: + +1. [交互式动画(上):iOS 10 以下的实现](http://www.jianshu.com/p/bbbdff8f01c5) +2. [交互式动画(下):UIViewPropertyAnimator in iOS 10](http://www.jianshu.com/p/6ac70183631e) + +这两篇文章也发布在 InfoQ 网站:[上](http://www.infoq.com/cn/articles/ios-interactive-animation-p1?utm_campaign=rightbar_v2&utm_source=infoq&utm_medium=articles_link&utm_content=link_text)和[下](http://www.infoq.com/cn/articles/ios-interactive-animation-p2)。 diff --git a/SDEDownloadManager/CellCustomOptions.png b/SDEDownloadManager/CellCustomOptions.png new file mode 100644 index 0000000..22d0b71 Binary files /dev/null and b/SDEDownloadManager/CellCustomOptions.png differ diff --git a/SDEDownloadManager/CellCustomOptions2.png b/SDEDownloadManager/CellCustomOptions2.png new file mode 100644 index 0000000..f32a0df Binary files /dev/null and b/SDEDownloadManager/CellCustomOptions2.png differ diff --git a/SDEDownloadManager/CellTypeA.png b/SDEDownloadManager/CellTypeA.png new file mode 100644 index 0000000..5067733 Binary files /dev/null and b/SDEDownloadManager/CellTypeA.png differ diff --git a/SDEDownloadManager/CellTypeB.png b/SDEDownloadManager/CellTypeB.png new file mode 100644 index 0000000..22e0c41 Binary files /dev/null and b/SDEDownloadManager/CellTypeB.png differ diff --git a/SDEDownloadManager/CellTypeC.png b/SDEDownloadManager/CellTypeC.png new file mode 100644 index 0000000..97b90af Binary files /dev/null and b/SDEDownloadManager/CellTypeC.png differ diff --git a/SDEDownloadManager/CellWithCustomButton.png b/SDEDownloadManager/CellWithCustomButton.png new file mode 100644 index 0000000..9395596 Binary files /dev/null and b/SDEDownloadManager/CellWithCustomButton.png differ diff --git a/SDEDownloadManager/CustomThumbail.png b/SDEDownloadManager/CustomThumbail.png new file mode 100644 index 0000000..83a58eb Binary files /dev/null and b/SDEDownloadManager/CustomThumbail.png differ diff --git a/SDEDownloadManager/DefaultThumbnail.png b/SDEDownloadManager/DefaultThumbnail.png new file mode 100644 index 0000000..8b369c8 Binary files /dev/null and b/SDEDownloadManager/DefaultThumbnail.png differ diff --git a/SDEDownloadManager/Demo.ManualSort.gif b/SDEDownloadManager/Demo.ManualSort.gif new file mode 100644 index 0000000..e7d6974 Binary files /dev/null and b/SDEDownloadManager/Demo.ManualSort.gif differ diff --git a/SDEDownloadManager/Demo.SortView.gif b/SDEDownloadManager/Demo.SortView.gif new file mode 100644 index 0000000..69eb5d0 Binary files /dev/null and b/SDEDownloadManager/Demo.SortView.gif differ diff --git a/SDEDownloadManager/Demo.TwoModes.gif b/SDEDownloadManager/Demo.TwoModes.gif new file mode 100644 index 0000000..292314f Binary files /dev/null and b/SDEDownloadManager/Demo.TwoModes.gif differ diff --git a/SDEDownloadManager/DownloadListType.png b/SDEDownloadManager/DownloadListType.png new file mode 100644 index 0000000..b4656e8 Binary files /dev/null and b/SDEDownloadManager/DownloadListType.png differ diff --git a/SDEDownloadManager/FinishedCellTypeA.png b/SDEDownloadManager/FinishedCellTypeA.png new file mode 100644 index 0000000..87a9faa Binary files /dev/null and b/SDEDownloadManager/FinishedCellTypeA.png differ diff --git a/SDEDownloadManager/ICON.png b/SDEDownloadManager/ICON.png new file mode 100644 index 0000000..2d18ea0 Binary files /dev/null and b/SDEDownloadManager/ICON.png differ diff --git a/SDEDownloadManager/LinkAtCellTop.png b/SDEDownloadManager/LinkAtCellTop.png new file mode 100644 index 0000000..a9921e3 Binary files /dev/null and b/SDEDownloadManager/LinkAtCellTop.png differ diff --git a/SDEDownloadManager/ManualSort.png b/SDEDownloadManager/ManualSort.png new file mode 100644 index 0000000..855f67d Binary files /dev/null and b/SDEDownloadManager/ManualSort.png differ diff --git a/SDEDownloadManager/NeteaseMusicCell.png b/SDEDownloadManager/NeteaseMusicCell.png new file mode 100644 index 0000000..1f41dff Binary files /dev/null and b/SDEDownloadManager/NeteaseMusicCell.png differ diff --git a/SDEDownloadManager/PresentSliderAlertController.png b/SDEDownloadManager/PresentSliderAlertController.png new file mode 100644 index 0000000..1394eab Binary files /dev/null and b/SDEDownloadManager/PresentSliderAlertController.png differ diff --git a/SDEDownloadManager/ReplaceIndexWithIcon.png b/SDEDownloadManager/ReplaceIndexWithIcon.png new file mode 100644 index 0000000..af0555f Binary files /dev/null and b/SDEDownloadManager/ReplaceIndexWithIcon.png differ diff --git a/SDEDownloadManager/Restart&Delete.png b/SDEDownloadManager/Restart&Delete.png new file mode 100644 index 0000000..8bd9de7 Binary files /dev/null and b/SDEDownloadManager/Restart&Delete.png differ diff --git a/SDEDownloadManager/Restore.png b/SDEDownloadManager/Restore.png new file mode 100644 index 0000000..136ab70 Binary files /dev/null and b/SDEDownloadManager/Restore.png differ diff --git a/SDEDownloadManager/SliderAlertController.png b/SDEDownloadManager/SliderAlertController.png new file mode 100644 index 0000000..36b0fc5 Binary files /dev/null and b/SDEDownloadManager/SliderAlertController.png differ diff --git a/SDEDownloadManager/SortListInTwoModes.png b/SDEDownloadManager/SortListInTwoModes.png new file mode 100644 index 0000000..3d3e598 Binary files /dev/null and b/SDEDownloadManager/SortListInTwoModes.png differ diff --git a/SDEDownloadManager/SortView.png b/SDEDownloadManager/SortView.png new file mode 100644 index 0000000..5290b71 Binary files /dev/null and b/SDEDownloadManager/SortView.png differ diff --git a/SDEDownloadManager/Stop&Delete.png b/SDEDownloadManager/Stop&Delete.png new file mode 100644 index 0000000..468fbcf Binary files /dev/null and b/SDEDownloadManager/Stop&Delete.png differ diff --git a/SDEDownloadManager/Swipe.CDC.Sort.png b/SDEDownloadManager/Swipe.CDC.Sort.png new file mode 100644 index 0000000..3efc370 Binary files /dev/null and b/SDEDownloadManager/Swipe.CDC.Sort.png differ diff --git a/SDEDownloadManager/ToolBar.Icon.png b/SDEDownloadManager/ToolBar.Icon.png new file mode 100644 index 0000000..55436f4 Binary files /dev/null and b/SDEDownloadManager/ToolBar.Icon.png differ diff --git a/SDEDownloadManager/ToolBar.Title.png b/SDEDownloadManager/ToolBar.Title.png new file mode 100644 index 0000000..b4febe3 Binary files /dev/null and b/SDEDownloadManager/ToolBar.Title.png differ diff --git a/SDEDownloadManager/TypicalCell.png b/SDEDownloadManager/TypicalCell.png new file mode 100644 index 0000000..327e9e3 Binary files /dev/null and b/SDEDownloadManager/TypicalCell.png differ