Replace @NSApplicationMain or @UIApplicationMain with main.swift
Let's say you want to run some code before your AppDelegate launches in a Swift application (like receipt validation.)
First, get rid of the @NSApplicationMain
or @UIApplicationMain
from your AppDelegate.swift
file:
Next, File->New->File...
to create a Swift file and name it main.swift
. Here's how it should look for an iOS app:
And Mac: