Zain Shahzad
Zain Shahzad

Reputation: 104

Assign orignal Image instead of taking UIImage in string

enter image description here

In swift 4 or even in previous version we can get the complete image though this code

ProfileImg.Image = marker.png 

etc but In swift 4.2, we can only have

UIimage.init(named: "marker")

Is it a version mistake or removed by own.???

Upvotes: 0

Views: 275

Answers (2)

matt
matt

Reputation: 535586

From the Xcode 10 beta release notes:

  • Code completion for Swift image literals was removed in Xcode 10. (38087260)

I imagine this was because the image literals were appearing in the completion list for everything and not just when the context involved UIImage, which was driving everybody crazy. Or maybe it's because the new editor can't accommodate the display of image literals.

The feature will either be restored in a future release or will be abandoned altogether. Time will tell!

Upvotes: 1

Cemal BAYRI
Cemal BAYRI

Reputation: 410

When you started to write mar.. you ll see the picker that contains your image in the assets. You can pick from here directly.

Upvotes: 0

Related Questions