Swift Playground

RSS for tag

Learn and explore coding in Swift through interactive learning experiences on the Swift Playground app for iPadOS and macOS.

Swift Playground Documentation

Posts under Swift Playground subtopic

Post

Replies

Boosts

Views

Activity

Cannot Upload Images on Swift Playground on XCode
Hello! I'm trying to upload images to Swift Playground on XCode, and it's not working. When I created my playground, there is no Resources folder or an assets file. If I simply drag an image file to the sidebar, the image is not showing up when used in the app. This may be a simple fix, but as a beginner, I am struggling to find the solution. Any help would be much appreciated! Thank you!
0
1
230
Jan ’26
In "Learning Programming 2", I can't use "world.place"
I'm trying the "Connect and Solve" course of Swift Playground. I can't use "world.place" to place bricks at positions (2, 2), (6, 2) (automatically disappear), but I can place bricks at positions (4, 2) in the same way. Two bricks must be placed overlapping in positions (2, 2) and (6, 2) to achieve the goal. Only when a brick is placed in position (4, 2) can the goal be achieved. The problem is that the bricks placed on (6, 2) and (2, 2) will disappear and cannot be placed successfully. The following is my code writing... let Block1 = Block() for i in 1 ... 2 { world.place(Block1, atColumn: 2, row: 2) } for i in 1 ... 2 { world.place(Block1, atColumn: 6, row: 2) } world.place(Block1, atColumn: 4, row: 2) func turnaround() { turnRight() turnRight() } func walk4() { for i in 1 ... 3 { moveForward() } } func collet() { for i in 1 ... 2 { moveForward() } toggleSwitch() turnRight() walk4() collectGem() turnaround() walk4() turnRight() } for i in 1 ... 3 { collet() } ‌I would appreciate it if someone could offer some recommendations.‌ ‌Thanks a lot‌
0
0
70
2w