elito25
elito25

Reputation: 642

How does importing within Swift work?

If I want to use Quartz and I type

import QuartzCore

for some reason, it works. If I type anything else, it doesn't work. When I check the documentation (Command click), it is a blank header file. How do I import headers?

Upvotes: 2

Views: 986

Answers (1)

Sudhir Bastakoti
Sudhir Bastakoti

Reputation: 100175

As per the docs, import works for any Objective-C framework (or C library) that is accessible as a module.Objective-C frameworks vend APIs in header files. In Swift, those header files are compiled down to Objective-C modules, which are then imported into Swift as Swift APIs.

Upvotes: 1

Related Questions