umbrella header - iOS framework or library in Objective-C may have a header file that contains links to all other headers in this project.
When you create the target framework, Xcode will automatically generate the <targer_name>.h file. It must have the same name as Product Name
Build Settings :
Product Name - Default: $(TARGET_NAME:c99extidentifier)Product Module Name - The default value is $(PRODUCT_NAME:c99extidentifier)
For example, <umbrella_name>.h looks like
#import "header_1.h" #import "header_2.h"
As a result, you can use the following syntax
#import <umbrella_name>.h
instead
#import <header_1>.h #import <header_2>.h
Also, the umbrella header also required by a typical module map structure [About] [Framework module example] [Manually creation]
In practice, when you create a Framework in Objective-C [Example] or Swift [Example] , this file will be created automatically using <product_name>
Import Objective-C into Swift as part of the target platform
In the umbrella header, import each Objective-C header that you want to represent in Swift.
Swift sees all the headers you publish in the umbrella header. The contents of the Objective-C files in this platform are automatically accessible from any Swift file in this target platform without import statements. Use classes and other declarations from your Objective-C code with the same Swift syntax that you use for system classes.
yoAlex5 Aug 13 '19 at 15:50 2019-08-13 15:50
source share