Skip to content

Instantly share code, notes, and snippets.

@pofat

pofat/main.swift

Last active Oct 17, 2020
Embed
What would you like to do?
How to write main function in a Swift iOS project
import Foundation
import UIKit
UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, NSStringFromClass(UIApplication.self), NSStringFromClass(AppDelegate.self))
// Remeber to comment or remove `@UIApplicationMain` in your AppDelegate.swift
@li-bei

This comment has been minimized.

Copy link

@li-bei li-bei commented Feb 17, 2020

Why not just pass CommandLine.unsafeArgv to UIApplicationMain's second parameter?

@pofat

This comment has been minimized.

Copy link
Owner Author

@pofat pofat commented Feb 18, 2020

Why not just pass CommandLine.unsafeArgv to UIApplicationMain's second parameter?

@kylinroc Thanks for the suggestion!!! I just did not notice that property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.