bugfender / BugfenderSDK-iOS

Bugfender SDK for iOS, a remote logger tailor-made for mobile
https://bugfender.com
Other
76 stars 30 forks source link

Swift support #2

Closed tonyxiao closed 9 years ago

tonyxiao commented 9 years ago

While objective c works seamlessly with Swift, C macros doesn't. In order to use Bugfender in swift something like this is needed

@interface Bugfender (Swift)

+ (void)logWithFilename:(NSString *)filename
             lineNumber:(int)lineNumber
           functionName:(NSString *)functionName
                    tag:(NSString *)tag
                  level:(BFLogLevel)level
                message:(NSString *)message;

@end
@implementation Bugfender (Swift)

+ (void)logWithFilename:(NSString *)filename
             lineNumber:(int)lineNumber
           functionName:(NSString *)functionName
                    tag:(NSString *)tag
                  level:(BFLogLevel)level
                message:(NSString *)message {
    __BFLog(lineNumber, functionName, filename, level, tag, message);
}

@end

It's not too bad, but it would be better if this function already existed within bugfender SDK itself so people trying to use it from swift don't have to do their own bridging.

jgimenez commented 9 years ago

Hi @tonyxiao this is already in the works, you'll have it ready very soon.