Xcode Playgrounds Adding Images, Static Data, Sounds, etc. to a Playground


Images, static data, sounds, etc. are resources in a Playground.

  1. If the Project Navigator is hidden, choose View > Navigators > Show Project Navigator (⌘1)
  2. There are several ways to add files
    • Drag your resources to the Resources folder or
    • Select the Resources folder and choose File > Add Files to "Resources" or
    • control-click the Resources folder and choose Add Files to "Resources"
  3. Use your resource. For example let i = UIImage(named: "tacos.jpg")