天天看點

dtcoretext概要

GitHub:

<a target="_blank" href="https://github.com/Cocoanetics/DTCoreText">https://github.com/Cocoanetics/DTCoreText</a>

接口文檔說明:

<a target="_blank" href="https://docs.cocoanetics.com/DTCoreText/">https://docs.cocoanetics.com/DTCoreText/</a>

DTCoreText庫包含三部分Parsing,Layouting,UI。

其中UI包含了我們常使用的類:

DTAttributedLabel 

用來代替UILabel使用的控件,顯示富文本,繼承自 DTAttributedTextContentView,可以使用delegate來處理image和hyperlink。

DTAttributedTextCell

作為tableViewCell來使用

DTAttributedTextContentView

用來顯示富文本,不應該直接被使用。

DTAttributedTextView

用來代替UITextView,繼承自UIScrollView,裡面放置了一個DTAttributedTextContentView用來顯示内容

DTLazyImageView

DTWebVideoView 

DTLinkButton  每個超連結都轉化為一個DTLinkButton來使用

 setup:

Linking裡的Other Linker Flags

Search Paths裡的Header Search Paths

說了這麼多,關鍵還是要去看dtcoretext的demo然後自己實踐才能領會。