Rewrite AppDelegate with Swift.