title: Converting An Objective-C AppDelegate Category Class To A Swift Class
body: <p>We have a project built with Cordova. However we are writing a lot of code in Swift. Due to a number of Xcode Bridging Header bugs too long to get into, we need to re-write our AppDelegate.m into Swift.</p>
  
  <p>That went just fine.</p>
  
  <p>However, there is a plugin for Cordova for <a href="https://github.com/phonegap-build/PushPlugin/blob/master/src/ios/AppDelegate%2Bnotification.m" rel="nofollow">push notifications</a>.</p>
  
  <p>This plugin has us install another file that is a Category of type AppDelegate.</p>
  
  <p>The top of its header file is as following:</p>
  
  <pre><code>@implementation AppDelegate (notification)
  </code></pre>
  
  <p>There are no categories in Swift, there are extensions. My question is this: When converting this file to Swift, should I just delete this file, and add it's extension to the existing AppDelegate file, or do a I create an AppDelegate+notification.swift class and just write?</p>
  
  <pre><code>extension AppDelegate {
  
  //code
  
  }
  </code></pre>
  
  <p>Basically I'm a little confused why there would be a separate file that adds functionality to the AppDelegate. Why wouldn't they just 'extend' it in the first place and now I'm not sure how to convert this AppDelegate+notification.m file to Swift.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I removed the main.m file, the AppDelegate.m/.h, and the AppDelegate+notification.m/.h file and converted them into the corresponding Swift AppDelegate files inside a new AppDelegate.swift file and it worked.</p>