What you're seeing there is an image literal . It's not the name for the image, it is the image — so using one is equivalent to the entire UIImage(named: "icon-stack")
call, not just the "icon-stack"
string within that call.
If you assign one of these directly to a var
or let
, you'll see that its inferred type is UIImage
(or NSImage
if targeting macOS):
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.