Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of all modules

From the Swift documentation:

Any Objective-C framework (or C library) that’s accessible as a module can be imported directly into Swift. This includes all of the Objective-C system frameworks—such as Foundation, UIKit, and SpriteKit—as well as common C libraries supplied with the system.

Where can I find the full list of available modules? I'm particularly interested in the common C libraries part.

like image 325
hpique Avatar asked Sep 29 '22 21:09

hpique


1 Answers

It's the same modules that can be imported in Objective-C using the @import statement (except the Swift module, which is the Swift standard library that is only available in Swift and is always imported in Swift anyway). So what you can do to discover them is:

  • Open an Objective-C project, turn support for modules on in build settings
  • type @import ... and type some letter, delete it, and the autocomplete should show you a list of all the modules you can import.

From what I can tell, besides the standard Cocoa system frameworks (like Foundation), the only potentially useful ones are:

  • Darwin - most of the C standard library, plus many POSIX things
  • ObjectiveC (also imported by Foundation) - the Objective-C runtime library (#import <objc/*>)
  • Dispatch (also imported by Foundation) - the dispatch library (#import <dispatch/dispatch.h>)
like image 68
user102008 Avatar answered Oct 18 '22 00:10

user102008