Is there a way to get the functionality of a prefix header in Swift? I don´t want to import external libs in every file where they are used.
Create a Objective-C Bridging Header file:
[New File→iOS→Source→Header File]:
Bridging-Header.h
Go to this new header and import your external libs:
@import Module1Name;
@import Module2Name;
...
Go to Build Settings, set the path of Objective-C Bridging Header:
[Target→Build Settings→Swift Compiler - Code Generation→Objective-C Bridging Header]:
$(SRCROOT)/.../Bridging-Header.h
Then you can use external libs in every file without import
code.
References: