AppDelegate rewritten with swift