Libraries import in Swift

Find this useful? Support us: Star on GitHub 6
Category: Importing Libraries | Language: Swift
In Swift, libraries are imported using the import keyword followed by the library's name. Here is an example of importing the Foundation library:
import Foundation
Likewise, if you want to use the UIKit framework, you would import it like this:

import UIKit

In addition to importing frameworks and libraries, you can also import your own code files using the import keyword followed by the file's name:

import MyCustomCode

``Swift
Where
MyCustomCode` is the name of your custom code file. Once the file has been imported, you can then use any functions and classes defined in it.