Latest 2.3.0
License MIT
Platforms ios 8.0, osx 10.9, tvos 9.0, requires ARC


The Crashlytics platform is unable to be included as a transitive dependency, meaning you are unable to use it in a framework that will be included in an application that uses Crashlytics. This library uses dependency injection to create a wrapper around the Crashlytics and Answers classes for use in other frameworks.


  • [x] Set custom keys on crash reports
  • [x] Record non-fatal errors
  • [x] Record Swift ErrorType errors with custom keys
  • [x] Logging using CLS_LOG
  • [x] Record events using Answers
  • [ ] Logging of custom exceptions


In Frameworks

CrashlyticsRecorder and AnswersRecorder act as wrappers for Crashlytics and Answers respectively. To use these classes, include this pod as a dependency for your framework. If you are using CocoaPods, this can be accomplished by adding the following lines to your Podfile and podspec.


pod 'CrashlyticsRecorder'


s.dependency 'CrashlyticsRecorder'

You can then use CrashlyticsRecorder.sharedInstance and AnswersRecorder.sharedInstance in your framework.

In Applications

In order for CrashlyticsRecorder to work properly in your application’s included frameworks, you will need to take a few steps.

  1. Include the CrashlyticsAdapter.swift file in your application target. Alternatively, you can copy the following code into your AppDelegate, or anywhere in your application target.
import Crashlytics
import CrashlyticsRecorder

extension Crashlytics: CrashlyticsProtocol {
    public func log(format: String, args: CVaListPointer) {
        #if DEBUG
            CLSNSLogv(format, args)
            CLSLogv(format, args)

extension Answers: AnswersProtocol { }
  1. Create the CrashlyticsRecorder and AnswersRecorder shared instances in your AppDelegate after setting up Crashlytics.
public func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    CrashlyticsRecorder.createSharedInstance(crashlytics: Crashlytics.sharedInstance())
    AnswersRecorder.createSharedInstance(answers: Answers.self)


You must have a Fabric account to use Crashlytics and the CrashlyticsRecorder in your applications.


Anthony Miller, [email protected]


CrashlyticsRecorder is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "CrashlyticsRecorder",
    "version": "2.3.0",
    "swift_version": "4.2",
    "summary": "A wrapper for the Crashlytics framework allowing it to be used as a transitive dependency via dependency injection.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Anthony Miller": "[email protected]"
    "source": {
        "git": "",
        "tag": "2.3.0"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "tvos": "9.0"
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*"

Pin It on Pinterest

Share This