简体   繁体   中英

Objective C library imported to Swift project via bridging header can only be seen in AppDelegate and not in other classes

I've managed to use Objective C library in the Swift AppDelegate.swift file via the bridging header. But the problem is that this library cannot be used in other class from the same project.. How is that?

Say, the enum member MMDrawerSide.Left can be successfully used in the AppDelegate class. But in the other class the compiler complains:

Use of unresolved identifier 'MMDrawerSide'

What can I do wrong? The steps for making the bridging header were pretty simple and automatic. Here's its contents:

#import "MMDrawerController.h"
#import "MMDrawerVisualState.h"
#import "UIViewController+MMDrawerController.h"

Thank you.

This is a very annoying issue i've had in the past. Try to add the objc bridging header to the swift compiler in the build settings. You may have already done this, it depends on how you made your bridging-header.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM