WKApplicationMain(_:_:_:)
Creates the application object and the application delegate, and sets up the app’s event cycle.
Declaration
func WKApplicationMain(_ argc: Int32, _ argv: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?>, _ applicationDelegateClassName: String?) -> Int32Parameters
- argc:
The count of arguments in
argv. This is usually the corresponding parameter tomain. - argv:
A variable list of arguments. This is usually the corresponding parameter to
main. - applicationDelegateClassName:
The name of the app delegate’s class. This class must subclass Nsobject Swift.class and adopt the Wkapplicationdelegate protocol.
Return Value
Even though this function specifies an integer return type, it never returns. When the user exits a watchOS app, the app moves to the background.
Discussion
This function instantiates the application object and the specified delegate (if any), and then sets the delegate for the application. It also sets up the main event loop, including the application’s run loop, and begins processing events.