2019-06-30

YYKit 有跡可循

  1. YYLabel -> _state == 23條(“bitfield”數(shù)據(jù)結(jié)構(gòu))

  2. YYTextMagnifier == 9條(以”類族模式”隱藏實現(xiàn)細(xì)節(jié))

  3. self.titles = @[].mutableCopy; == 4條(多用字面量語法,少用與之等價的方法)

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

  5. description + debugDescription == 17條(實現(xiàn)description方法)

  6. YYTextSelectionRect == 重寫的屬性 — 當(dāng)你在子類中重寫了父類中的屬性,你必須使用 @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 會保留其目標(biāo)對象)

  9. all about @autoreleasepool {...} == 34條(以"自動釋放池塊"降低內(nèi)存峰值)

  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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 話說,距離申請到屬于自己的微信公眾號“在電影路上”似乎已經(jīng)過去很久了,今天才落筆為它寫第一篇文章,真是于心有愧。而...
    司戴拉閱讀 358評論 0 0
  • 托吉林馬拉松的福,交警把平時水泄不通的停車場清理得清清爽爽。 夕陽下,慢悅生活館前美得像寧靜的湖面。微風(fēng)拂來,翠竹...
    木春閱讀 490評論 3 4
  • 圖文/無為跑者 常居笑意向陽追, 莫拿愁眉帶家歸。 針芒相對亦為伴, 無言盡愛唯恐吹。
    最家游閱讀 479評論 11 30

友情鏈接更多精彩內(nèi)容