Allow to initialize an UIImage from a URL.

Originator:steipete
Number:rdar://40984545 Date Originated:June 10 2018, 7:37 PM
Status:Open Resolved:
Product:UIKit Product Version:11.3/12
Classification:Suggestion Reproducible:
 
Area:
UIKit

Most images eventually come from http/https URLs. It's not trivial to write good code that downloads images. It usually involves following parts:

- Download image in background
- Progressive display
- Caching, LRU management, checking if file is the same/updated on the server
- resuming
- background decompressing

No wonder that rarely any app gets this right, and 3rd-party frameworks like SDWebImage, PINImage or Twitter Image Pipeline are popular.

Web browsers just do all of that as part of their core logic. Decompressing images is also hard and should ideally be abstracted away. It seems unreasonable to ask app developers to reinvent the wheel every single time.

Not even Apple gets this right, as you can see in the WWDC 2018 app:
https://twitter.com/steipete/status/1005579125787152384

Please add something like UIImage(from: URL("http://domain.com/image.jpg") that does the right thing for typical use cases (if URLs need auth, people can still aways roll their own)

Comments

Duped: rdar://41123533


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!