I have an iOS framework target, and I need integrate Crash reporting system for it.
So Crashlytics looks good, but
This Xcode project does not have any Mac or iOS targets
So, is there any way to integrate Crashlytics directly into iOS framework?
I have an iOS framework target, and I need integrate Crash reporting system for it.
So Crashlytics looks good, but
This Xcode project does not have any Mac or iOS targets
So, is there any way to integrate Crashlytics directly into iOS framework?
There is a solution here that allows your lib users to utilize crashlytics for logging.
Your lib can provide a default log function that calls NSLog or Print or what ever mechanism you want. But also have your library provide a mechanism to override the print method used.
For example, imagine you have a Logger class defined in your library:
public class Logger {
private static var printer: (message: String) -> Void = nil
public static func setPrinter(newPrinter: (message: String) -> Void) {
Logger.printer = newPrinter
}
debug(format: String, ...) {
// convert params into a single formatted:String, then ...
if(Logger.printer != nil) {
Logger.printer(message: formatted)
} else {
print(formatted)
// or
NSLog(formatted)
}
}
}
Now, when people use your library they will get default printing you implement. But, if they have their own logging solution, like crashlytics they can override it like so:
// in their App code
Logger.setPrinter((message:String) -> Void {
CLSNSLog(message)
});