How to load specific image from assets with Swift
Since swift 3.0 there is more convenient way: #imageLiterals here is text example. And below animated example from here:
You cannot load images directly with @2x
or @3x
, system selects appropriate image automatically, just specify the name using UIImage
:
UIImage(named: "green-square-Retina")