CoronaDelegate

Type Obj-C Protocol
Revision 2017.3060
Keywords iOS, Corona Enterprise, CoronaDelegate
See also Corona Enterprise — iOS
CoronaRuntime

Overview

CoronaDelegate is an Obj-C protocol that gets invoked by the Corona engine at key points in your app's execution, for example at startup.

Your code must implement this protocol if you wish to add your own functions at the Lua layer.

Application Lifecycle

You can intercept UIApplicationDelegate events via your implementation of the CoronaDelegate protocol. This protocol conforms to the UIApplicationDelegate protocol. Corona's internal delegate will call your protocol's method if it's implemented.

Notes
  • Methods that Apple has deprecated will be ignored.
  • In most cases, your class' version will be invoked after Corona's corresponding version of the UIApplicationDelegate method. The only situation in which your version will be called before is where the app is about to suspend or go to the background, for example applicationWillResignActive: and applicationDidEnterBackground:.

Methods

(Inherits methods from UIApplicationDelegate)

willLoadMain:

Called directly before main.lua is executed. You should register your Lua extensions here. In the following syntax, runtime is an object that conforms to the CoronaRuntime protocol.

- (void)willLoadMain:id<Runtime>runtime

didLoadMain:

Called directly after main.lua is executed. In the following syntax, runtime is an object that conforms to the CoronaRuntime protocol.

- (void)didLoadMain:id<Runtime>runtime