Search code examples
iosobjective-cswiftbridging-header

Swift Bridging Header File Not Found


I'm having some trouble importing some headers from CocoaPods and an external library (ConnectSDK) into my bridging header.

I'm getting the following error:

'MZFormSheetPresentationController/MZFormSheetPresentationController Swift Example-Bridging-Header.h' file not found

My Pods framework is weakly linked to my target.

Any help really appreciated, scratching my head with this.

UPDATE: Below is my bridging header

#ifndef _Bridge_h
#define _Bridge_h

#import <GoogleCast/GoogleCast.h>
#import <MZFormSheetPresentationController/MZFormSheetPresentationController Swift Example-Bridging-Header.h>
#import <ConnectSDK/ConnectSDK.h>
#import <ConnectSDK/CastService.h>
#import <ConnectSDK/CastDiscoveryProvider.h>
#import <ConnectSDK/DIALService.h>
#import <ConnectSDK/SSDPDiscoveryProvider.h>
#import <ConnectSDK/RokuService.h>
#import <ConnectSDK/DLNAService.h>
#import <ConnectSDK/WebOSTVService.h>
#import <ConnectSDK/FireTVService.h>
#import <ConnectSDK/FireTVDiscoveryProvider.h>
#import <TUSafariActivity/TUSafariActivity.h>

#endif

Solution

  • I suspect the spaces are causing problems.

    And the import line in the bridging header should be something like this:

    #import <MZFormSheetPresentationController/MZFormSheetPresentationController.h>
    

    Update:

    I assume you are trying to run the Example from here: https://github.com/m1entus/MZFormSheetPresentationController

    It seems like that bridging header file was accidentally removed (or was never there).

    You can create your bridging header by following the instructions here: https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html

    with the following contents:

    #import <MZFormSheetPresentationViewController/MZFormSheetPresentationController.h>
    

    Update 2:

    Can you change this line: #import <MZFormSheetPresentationController/MZFormSheetPresentationController Swift Example-Bridging-Header.h>

    to

    <MZFormSheetPresentationViewController/MZFormSheetPresentationController.h>