It certainly can.
This special file is called , and it behaves exactly the same as the file in the playground. main.swift
From Files and Initialization , Apple Swift Blog Post:
... main.swift , , . , "main.swift" . Swift line - , "main.swift".
, iOS, @UIApplicationMain
- . . main.swift
iOS .
Swift 3.1 main.swift
:
import Foundation
import UIKit
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
}
UIApplicationMain(
CommandLine.argc,
UnsafeMutableRawPointer(CommandLine.unsafeArgv)
.bindMemory(
to: UnsafeMutablePointer<Int8>.self,
capacity: Int(CommandLine.argc)),
nil,
NSStringFromClass(AppDelegate.self)
)
UIApplicationMain ββMatt Neuburg.