版本記錄
版本號 | 時間 |
---|---|
V1.0 | 2018.03.29 |
前言
iOS圈內有幾個人大家基本都知道栗恩,比如說王巍巨双、唐巧,還有YYKit框架的作者現(xiàn)任職于滴滴的郭曜源 - ibireme等侠仇。這里有一篇唐巧對他的專訪轻姿,還有他的 GitHub - Yaoyuan 和 博客,這里貼出來框架YYKit 框架逻炊。接下來幾篇我們就一起來看一下這個框架互亮。感興趣的可以看上面寫的幾篇。
1. YYKit源碼探究(一) —— 基本概覽
2. YYKit源碼探究(二) —— NSString分類之Hash(一)
3. YYKit源碼探究(三) —— NSString分類之Encode and decode(二)
4. YYKit源碼探究(四) —— NSString分類之Drawing(三)
5. YYKit源碼探究(五) —— NSString分類之Regular Expression(四)
6. YYKit源碼探究(六) —— NSString分類之NSNumber Compatible(五)
7. YYKit源碼探究(七) —— NSString分類之Utilities(六)
8. YYKit源碼探究(八) —— NSNumber分類(一)
9. YYKit源碼探究(九) —— UIFont分類之架構分析和Font Traits(一)
10. YYKit源碼探究(十) —— UIFont分類之Create font(二)
11. YYKit源碼探究(十一) —— UIFont分類之Load and unload font(三)
12. YYKit源碼探究(十二) —— UIFont分類之Dump font data(四)
13. YYKit源碼探究(十三) —— UIImage分類之框架結構和Create image部分(一)
14. YYKit源碼探究(十四) —— UIImage分類之Image Info(二)
15. YYKit源碼探究(十五) —— UIImage分類之Modify Image(三)
16. YYKit源碼探究(十六) —— UIImage分類之Image Effect(四)
17. YYKit源碼探究(十七) —— UIImageView分類之架構和image部分(一)
18. YYKit源碼探究(十八) —— UIImageView分類之highlight image部分(二)
19. YYKit源碼探究(十九) —— UIScreen分類(一)
20. YYKit源碼探究(二十) —— UIScrollView分類(一)
21. YYKit源碼探究(二十一) —— UITableView分類(一)
22. YYKit源碼探究(二十二) —— UITextField分類(一)
23. YYKit源碼探究(二十三) —— UIView分類(一)
24. YYKit源碼探究(二十四) —— UIPasteboard分類(一)
25. YYKit源碼探究(二十五) —— UIGestureRecognizer分類(一)
26. YYKit源碼探究(二十六) —— UIDevice分類框架及Device Information(一)
27. YYKit源碼探究(二十七) —— UIDevice分類之Network Information(二)
28. YYKit源碼探究(二十八) —— UIDevice分類之Disk Space(三)
29. YYKit源碼探究(二十九) —— UIDevice分類之Memory Information(四)
30. YYKit源碼探究(三十) —— UIDevice分類之CPU Information(五)
31. YYKit源碼探究(三十一) —— UIControl分類(一)
32. YYKit源碼探究(三十二) —— UIColor分類之Create a UIColor Object(一)
33. YYKit源碼探究(三十三) —— UIColor分類之Get color's description(二)
34. YYKit源碼探究(三十四) —— UIColor分類之Retrieving Color Information(三)
35. YYKit源碼探究(三十五) —— UIButton分類之image(一)
回顧
上一篇主要介紹了UIButton
分類image
部分余素,這一篇主要看一下UIButton
分類background image
部分胳挎。
API
下面我們一起來看一下API文檔。
/**
Current backgroundImage URL for the specified state.
@return The image URL, or nil.
*/
- (nullable NSURL *)backgroundImageURLForState:(UIControlState)state;
/**
Set the button's backgroundImage with a specified URL for the specified state.
@param imageURL The image url (remote or local file path).
@param state The state that uses the specified image.
@param placeholder The image to be set initially, until the image request finishes.
*/
- (void)setBackgroundImageWithURL:(nullable NSURL *)imageURL
forState:(UIControlState)state
placeholder:(nullable UIImage *)placeholder;
/**
Set the button's backgroundImage with a specified URL for the specified state.
@param imageURL The image url (remote or local file path).
@param state The state that uses the specified image.
@param options The options to use when request the image.
*/
- (void)setBackgroundImageWithURL:(nullable NSURL *)imageURL
forState:(UIControlState)state
options:(YYWebImageOptions)options;
/**
Set the button's backgroundImage with a specified URL for the specified state.
@param imageURL The image url (remote or local file path).
@param state The state that uses the specified image.
@param placeholder The image to be set initially, until the image request finishes.
@param options The options to use when request the image.
@param completion The block invoked (on main thread) when image request completed.
*/
- (void)setBackgroundImageWithURL:(nullable NSURL *)imageURL
forState:(UIControlState)state
placeholder:(nullable UIImage *)placeholder
options:(YYWebImageOptions)options
completion:(nullable YYWebImageCompletionBlock)completion;
/**
Set the button's backgroundImage with a specified URL for the specified state.
@param imageURL The image url (remote or local file path).
@param state The state that uses the specified image.
@param placeholder The image to be set initially, until the image request finishes.
@param options The options to use when request the image.
@param progress The block invoked (on main thread) during image request.
@param transform The block invoked (on background thread) to do additional image process.
@param completion The block invoked (on main thread) when image request completed.
*/
- (void)setBackgroundImageWithURL:(nullable NSURL *)imageURL
forState:(UIControlState)state
placeholder:(nullable UIImage *)placeholder
options:(YYWebImageOptions)options
progress:(nullable YYWebImageProgressBlock)progress
transform:(nullable YYWebImageTransformBlock)transform
completion:(nullable YYWebImageCompletionBlock)completion;
/**
Set the button's backgroundImage with a specified URL for the specified state.
@param imageURL The image url (remote or local file path).
@param state The state that uses the specified image.
@param placeholder The image to be set initially, until the image request finishes.
@param options The options to use when request the image.
@param manager The manager to create image request operation.
@param progress The block invoked (on main thread) during image request.
@param transform The block invoked (on background thread) to do additional image process.
@param completion The block invoked (on main thread) when image request completed.
*/
- (void)setBackgroundImageWithURL:(nullable NSURL *)imageURL
forState:(UIControlState)state
placeholder:(nullable UIImage *)placeholder
options:(YYWebImageOptions)options
manager:(nullable YYWebImageManager *)manager
progress:(nullable YYWebImageProgressBlock)progress
transform:(nullable YYWebImageTransformBlock)transform
completion:(nullable YYWebImageCompletionBlock)completion;
/**
Cancel the current backgroundImage request for a specified state.
@param state The state that uses the specified image.
*/
- (void)cancelBackgroundImageRequestForState:(UIControlState)state;
這里只給出API接口溺森,具體實現(xiàn)和上一篇的image部分是類似的慕爬,這里就不多說了。
后記
本篇主要講述了background image部分屏积,感興趣的可以給個贊和關注医窿,謝謝~~~