I have encountered this "bug" ? in compiling with Xcode 11.3.1.
The program compiles and runs fine but the code below does not execute, and the image does not load:
- if let faceCardImage = UIImage(named: "J♥") {
- faceCardImage.draw(in: bounds.zoom(by: SizeRatio.faceCardImageSizeToBoundsSize))
- }
However if I change the code, only the string in the call to UIImage to a string without Emoji the image loads nicely
if let faceCardImage = UIImage(named: "11J") {
faceCardImage.draw(in: bounds.zoom(by: SizeRatio.faceCardImageSizeToBoundsSize))
}
Both images J♥ and11Jexist in Assets.xcassets.
For further information the code comes from Lecture 6 of the Stanford CS195 2017-2018 course.
I have tried different options of typing the string without any success.
I had it running ok in 2018, but is going through the course to refresh my memory.
Has anyone an idea of why this does not work ? Or has something changed in Swift since?
Any light/explanation on this problem will be highly appreciated.
Best regards
Lars C