Reputation: 3627
Suppose I have a swift library that consists of a large folder with subfolders with subfolders all containing many .swift files I would like my .swift project to be aware of - just as if I had written all that code myself.
My swift project targets ios7+ meaning there are some issues with various package systems - and the given library I am trying to add acually suggests using the above method.
Currenly I have "attached" the swift-library-folder next to my own .swift files and during this I checked all targets.
Interestingly, I can not change/add targets for any of the files in the folder since the option does not show itself when clicking the .swift files in xcode (!)
Anyhow, when trying to use one of the classes defined in he swift-library, xcode does not recognize it.
What am i doing wrong?
Upvotes: 1
Views: 77
Reputation: 535304
My guess is that you dragg the folder containing these files into Xcode, rather than the individual files. That was the first issue, since that sort of thing has a special meaning. Then, you saw a dialog like this:
I'm not sure what you did at that moment, but I don't think your settings looked like mine! They need to. Delete the files and perform this import again.
For best results, select just the Swift files in the Finder and drag them into Xcode this time. (You can drag them all at once, in one move; but drag the files, not a folder.) But if you can't do that, make sure you are creating groups — not folder references.
Upvotes: 1