Skip to content

This is a fork of SwiftWeather; an iOS weather app developed in Swift 2. The 3 commits demonstrate how to integrate Rollbar into a Swift application.

License

Notifications You must be signed in to change notification settings

Crisfole/SwiftWeather

 
 

Repository files navigation

This is a fork of JakeLin/SwiftWeather. Here are the steps I took to get Rollbar integrated into the project without cocoapods:

  1. Download the Rollbar Framework Files

  2. Open XCode and Drag the (unzipped) framework files into your solution.

  3. 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.
  4. 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
    }
  5. Now Any Uncaught Objective C style errors will be automatically reported to rollbar

  6. You can use Rollbar.logWithLevel to report Swift Style errors manually

About

This is a fork of SwiftWeather; an iOS weather app developed in Swift 2. The 3 commits demonstrate how to integrate Rollbar into a Swift application.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 75.7%
  • Swift 14.7%
  • C 9.5%
  • Ruby 0.1%