A framework is a type of bundle that packages dynamic shared libraries with the resources that the library requires, including files (nibs and images), localized strings, header files, and maybe documentation. The .framework is an Apple structure that contains all of the files that make up a framework.
Frameworks are stored in the following location (where the * is the name of an app or framework):
- /Library/Application Support/*/*.app/Contents/
If you just browse through these directories, you’ll see so many things you can use in apps. You can easily add an import followed by the name in your view controllers in Swift. For example, in /System/Library/Frameworks you’ll find the Foundation.framework. Foundation is pretty common as it contains a number of APIs such as NSObject (NSDate, NSString, and NSDateFormatter).
You can import this into a script using the following line:
As with importing frameworks/modules/whatever (according to the language) – you can then consume the methods/variables/etc in your code (e.g. let url = NSURL(fileURLWithPath: “names.plist”).