This was answered in this old thread
https://forums.developer.apple.com/thread/49061
In AppDelegate.swift file, I see a line of code at the very top, just below an import keyword. It says "@UIApplicationMain". What does that line of code do?
It indicates that this class should be treated as the app delegate for a UIKit based application. If you leave it out then you have to add a
main.swift
file that calls the
UIApplicationMain
function. This is unnecessary boilerplate, so Swift has a nice shortcut to avoid it.
What does the"@" at the beginning mean?
The
@
character introduces a Swift attribute, which modifies the following class declaration.
This will provide mor details
h ttps://medium.com/@Dougly/breaking-down-the-appdelegate-swift-3-258e48f907d6
Edited
used this as main.swift
import UIKit
UIApplicationMain(
CommandLine.argc,
CommandLine.unsafeArgv,
nil,
NSStringFromClass(AppDelegate.self)
)