// *** before: ***
// the entry point was a file named main.swift with top-level code in it,
// and that file lived by rules of its own
// main.swift:
// let tool = Tool()
// tool.run()
// an application marked its delegate instead
// @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { }
// *** in version 5.3: ***
@main
struct Tool {
static func main() {
print("started")
}
}
// the type may be a struct, a class or an enum, and main() may be throwing;
// exactly one type in the module carries the attribute, and there must be
// no main.swift beside it.
// @UIApplicationMain and @NSApplicationMain became special cases of this