2019-06-30

YYKit 有迹可循

  1. YYLabel -> _state == 23条(“bitfield”数据结构)

  2. YYTextMagnifier == 9条(以”类族模式”隐藏实现细节)

  3. self.titles = @[].mutableCopy; == 4条(多用字面量语法,少用与之等价的方法)

  4. iOS 保持界面流畅的技巧 == CA高级技巧中很多,CPU & GPU

  5. description + debugDescription == 17条(实现description方法)

  6. YYTextSelectionRect == 重写的属性 — 当你在子类中重写了父类中的属性,你必须使用 @synthesize 来手动合成ivar。

  7. YYTextInput — (YYTextPosition + YYTextRange) == Text Programming Guide for iOS - Lower Level Text-Handling Technologies - A Guided Tour of a UITextInput Implementation

  8. YYWeakProxy + (NSTimer+YYAdd) == 52条(NSTimer 会保留其目标对象)

  9. all about @autoreleasepool {...} == 34条(以"自动释放池块"降低内存峰值)

  10. YYThreadSafeDictionary == PSPDFThreadSafeMutableDictionary in The Foundation Collection Classes

  11. YYMemoryCache LRU linked list == switching to custom caching code based on a LRU linked list in The Foundation Collection Classes

  12. YYDispatchQueuePool(Qos) == Prioritize Work with Quality of Service Classes

  13. YYTimer == Minimize Timer Use - Get Event Notifications Without Using Timers

YYLabel

YYLabel
.h - like UILabel + Async
.m - ReleaseQueue + _innerLayout + _highlightLayout(LongPressTimer(callback))
-YYAsyncLayer + Touches Methods(about highlight)
-YYAsyncLayerDelegate

YYTextLayout
.h - container + layout + Draw
.m - container - encap property All methods is thread-safe.
-layout - layoutWithContainer - ((cgPath + frameAttrs)->ctFrame)->CoreText objects->YYTextLine + needTruncation(truncationToken) + textBoundingSize + iterator text for draw property
-Draw

YYTextLine - encap CTLine for OC property

YYTextInput - encap model
-YYTextPosition : UITextPosition
-YYTextRange : UITextRange
-YYTextSelectionRect : UITextSelectionRect

YYTextAttribute - encap model
-YYTextBackedString
-YYTextBinding
-YYTextShadow
-YYTextDecoration
-YYTextBorder
-YYTextAttachment
-YYTextHighlight

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 话说,距离申请到属于自己的微信公众号“在电影路上”似乎已经过去很久了,今天才落笔为它写第一篇文章,真是于心有愧。而...
    司戴拉阅读 2,555评论 0 0
  • 托吉林马拉松的福,交警把平时水泄不通的停车场清理得清清爽爽。 夕阳下,慢悦生活馆前美得像宁静的湖面。微风拂来,翠竹...
    木春阅读 3,233评论 3 4
  • 图文/无为跑者 常居笑意向阳追, 莫拿愁眉带家归。 针芒相对亦为伴, 无言尽爱唯恐吹。
    最家游阅读 3,130评论 11 30

友情链接更多精彩内容