-
-
Save tib/3541bc9e2c643f6578b4d884e32fcd85 to your computer and use it in GitHub Desktop.
How to write main function in a Swift iOS project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
private let pointer = UnsafeMutableRawPointer(CommandLine.unsafeArgv).bindMemory(to: UnsafeMutablePointer<Int8>.self, capacity: Int(CommandLine.argc)) | |
UIApplicationMain(CommandLine.argc, pointer, NSStringFromClass(UIApplication.self), NSStringFromClass(AppDelegate.self)) | |
// Remeber to comment or remove `@UIApplicationMain` in your AppDelegate.swift |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment