1.經過分類的方式,對外暴露接口。
2.給分類添加屬性,經過imageURLStorageKey值,將self 和 字典進行綁定。
經過sd_imageURLForState等方法進行取值。
3.調用UIView +WebCache 的sd_internalSetImageWithURL方法 ,設置operationKey值。
button 設置圖片——>UIButtonImageOperation
button 設置背景圖片 ——>UIButtonBackgroundImageOperation
UIImageView +webCache 也是作了一樣的事情,只不過沒有賦operationKey值。
MKAnnotationView +webCache