I am trying to create a file in OS X that is essentially a package that has files in it, similar to how a Logic project is a single file but contains all of the audio files within it (when you right-click the file it has the "Show Package Contents" option).
Doing this in Swift would be great, but also curious just in general how this is done? I haven't had much luck.
You need to define a "Document Package" type. Basically these "packages" are just a directory with a file extension applied that tells macOS to display them as a package. As long as you setup the type in your applications Info.plist
then you shouldn't need any special API's to create the packages (though apple does have some helper APIs if you want to use them).
For complete documentation on defining a new "Document Package" type and some links to some helper API's see: https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFBundles/DocumentPackages/DocumentPackages.html