title: Is it bad practice to declare the AppDelegate class as 'final' in swift?
body: <p>Right now, I'm trying to use a class from Git called Insomnia to prevent the device from locking while it is charging. The <a href="https://github.com/ochococo/Insomnia" rel="nofollow noreferrer">project</a> is here if you're curious. For the example code, it has me doing this:</p>
  
  <pre><code>final class AppDelegate: UIResponder, UIApplicationDelegate {
        private let insomnia = Insomnia(mode: .whenCharging)
        //app delegate code
   }
  </code></pre>
  
  <p>As you can see, it has you declare the <code>AppDelegate</code> as <code>final</code> so that the <code>insomnia</code> variable isn't deallocated, which would stop it from working. However, I wasn't sure, is this bad practice to declare my <code>AppDelegate</code> as <code>final</code>? Or will this cause issues for my app? If it is bad practice, is there a better way of making sure <code>insomnia</code> isn't deallocated?</p>