This is a fork of JakeLin/SwiftWeather. Here are the steps I took to get Rollbar integrated into the project without cocoapods:
-
Download the Rollbar Framework Files
-
Open XCode and Drag the (unzipped) framework files into your solution.
-
If you don't have a bridging file already correctly working:
- Add an objective-c (.m) file.
- XCode will prompt you to create a bridging file, allow it to do so.
- Open the bridinging file, and add the following lines:
#ifndef ContextJar_Bridging_Header_h #define ContextJar_Bridging_Header_h #import <SystemConfiguration/SystemConfiguration.h> #import <Rollbar/Rollbar.h> #endif /* ContextJar_Bridging_Header_h */
- delete the added
.m
file.
-
Initialize Rollbar in AppDelegate like so:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. let config: RollbarConfiguration = RollbarConfiguration() config.environment = "production" Rollbar.initWithAccessToken("YOUR ACCESS TOKEN", configuration: config) return true }
-
Now Any Uncaught Objective C style errors will be automatically reported to rollbar
-
You can use
Rollbar.logWithLevel
to report Swift Style errors manually