How do I add images into Swift playground through my camera roll. In the “learn to code 3”, it allowed you to add any photo from your camera roll. I looked into a article on stack overflow, but it seems to be for the computer version. How do I add images on Swift playgrounds for iPad? I know that you will need to use UIKIT
Asked
Active
Viewed 943 times
0
-
Possible duplicate of [Swift playgrounds with UIImage](https://stackoverflow.com/questions/24069479/swift-playgrounds-with-uiimage) – excitedmicrobe Nov 28 '18 at 19:44
-
@excitedmicrobe no it's not. He's asking for Swift Playgrounds on iPad – Robert Dresler Nov 28 '18 at 19:45
2 Answers
1
First write this
let image: Image =
then you will see this icon over the keyboard
tap on it and then you will be able to see this view where you can select image.

Robert Dresler
- 10,580
- 2
- 22
- 40
-
-
@JohnSong you can replace Image with UIImage, then you have to import UIKit – Robert Dresler Nov 29 '18 at 19:26
-
1
0
I'm sorry, but it will break if you try to put it into a live view. Sorry. This only works on Apple's playgrounds or on playgrounds without a live view.

AlexH
- 828
- 7
- 26