Skip to content

Feature request: Allows the UIButton to check and set different state for current progress and transition #2701

@dreampiggy

Description

@dreampiggy

New Issue Checklist

Feature Description

SDWebImage's UIView+WebCache, provide some properties, like

  • sd_imageURL
  • sd_imageProgress
  • sd_imageTransition

It works great for normal UIImageView, which have one single image to be query and load.

However, things become more complicated when using these properties on UIButton, because UIButton have different state, each state can represent a different image query pipelilne. See the already exist API:

- (void)sd_setImageWithURL:(nullable NSURL *)url
                  forState:(UIControlState)state NS_REFINED_FOR_SWIFT;

So, actually, these properties, which tied to single image request, should also have a correspond API for different UIButton state. Like the following:

  • sd_imageURLForState: Already Done
  • sd_imageProgressForState:
  • sd_imageTransitionForState:

Similar use case

The same thing, can also apply for the UIImageView+HighlightedWebCache, which should have the coorespond APIs like the following:

  • sd_highlightedImageURL
  • sd_highlightedImageProgress
  • sd_highlightedImageTransition

Note: The Indicator feature, is not under consideration for this case, because from all the usage, the indicator on UIButton is not a good idea. And it's a UIView's subview, it's not designed to dynamically removed and re-add base on state.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions