Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for Swift developers #60

Closed
davejlong opened this issue Oct 8, 2015 · 1 comment
Closed

Documentation for Swift developers #60

davejlong opened this issue Oct 8, 2015 · 1 comment

Comments

@davejlong
Copy link

I'm attempting to install Bugsnag in an application using Swift 2. I have installed the library through Cocoapods and adding the import to my bridging header:

#ifndef GoDriver_Bridging_Header_h
#define GoDriver_Bridging_Header_h

#import "Bugsnag/Bugsnag.h"

#endif /* GoDriver_Bridging_Header_h */

I then attempted to initialize Bugsnag in my AppDelegate:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.
    Bugsnag.startBugsnagWithApiKey("...")

    return true
}

But Xcode errors with Use of unresolved identifier 'Bugsnag' on the line in AppDelegate.

In my opinion, Bugsnag should have documentation for using the notifier with Swift as well as Objective-C applications.

@regnerjr
Copy link
Contributor

On my project we are using Bugsnag through cocoapods with the use_frameworks! directive in our pod file.

platform :ios, '9.0'
use_frameworks!

def pods
   pod 'Bugsnag', :git => "https://github.com/bugsnag/bugsnag-cocoa.git"
end

target 'AwesomeApp' do
   pods
end

No bridging header required. Just import Bugsnag in your AppDelegate
Then

Bugsnag.startBugsnagWithApiKey(myAPIKey)
Bugsnag.configuration().releaseStage = "Local Development"

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants