1

I have a playground running in XCode 12.3. When I create public classes with public methods in the Sources folder I am able to access these classes in the playground but not within other files in the Sources folder.

Example: A.swift(everything public) and B.swift(everything public) in the Sources folder. I am able instantiate objects within the playground. But when I try to create a property of type B in A.Swift the following error occurs:

"Cannot find 'B' in scope". So within the Source folder they don't know of each other even though they are public.

I know there is a other thread with the same question, but there is no clear solution. (Sources referencing each other in XCode Playgrounds)

How can I solve this?

A. Ehrlich
  • 11
  • 1
  • are you importing them (just like you need to import Foundation or Cocoa)? – Volker Jan 12 '21 at 06:02
  • No, how is this possible. But for testing I downloaded a test project which was working for others - there was no import of any files. I wonder if there is a Xcode setting or something like that. Anyways - thanks for your answer. – A. Ehrlich Jan 12 '21 at 19:35

0 Answers0