I work on a project that was developed by other person, so I don't exactly know how he proceed. Anyway...
I have to had a new fonctionnality in Swift in Objc based project. So I add bridging header. All project work, except for one thing.
I have this class AGZClient.m (just part of)
@implementation AGZClient
+ (AGZClient *)sharedAGZClient
{
static AGZClient *_sharedAGZClient = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_sharedAGZClient = [[self alloc] initWithBaseURL:[NSURL URLWithString:agendizeURLString]];
});
return _sharedAGZClient;
}
- (instancetype)initWithBaseURL:(NSURL *)url
{
self = [super initWithBaseURL:url];
if (self) {
self.responseSerializer = [AFJSONResponseSerializer serializer];
self.requestSerializer = [AFJSONRequestSerializer serializer];
//self.requestSerializer.timeoutInterval = 10.0;
self.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html", @"application/json", nil];
}
return self;
}
with AGZClient.h (part of also)
@protocol AGZClientDelegate;
@interface AGZClient : AFHTTPSessionManager
@property (nonatomic, weak) id<AGZClientDelegate>delegate;
+ (AGZClient *)sharedAGZClient;
- (instancetype)initWithBaseURL:(NSURL *)url;
The problem is that I'm unable to access to this class in Swift code (but it work in previous objc code). And yes, my class is in my bridging-header.h
#import "AGZClient.h"
And bridging header is in the build settings.
When I try to do
var client = AGZClient.sharedAGZClient()
I have
use of unresolved identifier "AGZClient"
I try with other classes but it works. I have absolutely no idea of what is the problem...