Swift | No Main Method | No Entry Point | iOS App

That is interesting to see, there is no main() for Swift iOS project.

Because Cocoa Touch uses the @UIApplicationMain attribute (for Cocoa its @NSApplicationMain) to indicate that it is the application delegate, Using this attribute is equivalent to calling UIApplicationMain function and passing the class name of the delegate class.

If you do not use this attribute, than supply a main.swift file with code at top level that calls the UIApplicationMain(_:_:_:_:) it means if you app uses custom subclass of UIApplication as its principle class, call the UIApplicationMain(_:_:_:_:) function instead of using this attribute.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.