-1

In the playground app, I am trying to upload an image, I google it and many solutions said that I need to put my image to resources. But the case is that in the new playground app, the is no resources folder that's why I couldn't add my image. There are shared Sources and Xcode sources but in these files, I couldn't put my image.

this can be an easy question but the case that I struggle with. And in order to continue my project, this point madden me. Thanks

as you can see, there aren't resources that ı could put my image as you can see, there aren't resources that ı could put my image

there is space for adding an image but in this case, the problem is that after ı chose my image nothing happened

there is space for adding an image but in this case, the problem is that after ı chose my image nothing happened

1 Answers1

0

UIImage can be loaded to the Playground app like this,

  1. File --> New Blank Playground.
  2. Click on the '+" icon on the top right corner and choose the picture by clicking Insert from... option.
  3. Load the image with its name from the Playground.

    UIImage(named: "test.png")

Output with loaded image

  • yeah, but as I indicated in question the problem is that there is no resources file when I want to open my playground in Playgrounds App not XCode Playground. There is a difference. Btw thank you for your afford – Ali Eren AK May 10 '20 at 01:27
  • I have edited the answer and loaded image to Playgrounds app. Hope it helps ! – Vinayaka S Yattinahalli May 10 '20 at 04:23