Reputation: 5979
I am using 3rd party external framework in my objective-c project. I created an swift file in this project to use the framework.
In MyModule-Bridging-Header.h I have import external framework header
#import “ext-service/ext-service.h”
In the ext-service.h there is an constant:
typedef NS_ENUM(NSInteger, service_err_t) {
SERVICE_SUCCESS = 1
}
In my swift code
//Compiler error: use of unresolved identifier ‘SERVICE_SUCCESS’
if result == SERVICE_SUCCESS{
NSLog(“successful!”)
}
But I get compiler error:
use of unresolved identifier ‘SERVICE_SUCCESS’
Why?
Upvotes: 1
Views: 735
Reputation: 3960
The reason to the error you mentioned is SERVICE_SUCESS
is unavailable(unknown).
There are 2 possible solutions:
service_err_t.SERVICE_SUCCESS
instead of SERVICE_SUCESS
result
is of type service_err_t
then just using .SERVICE_SUCESS
Hope this helps!
Upvotes: 3