i have a macos app that has no UI, its a Launch Daemon, and since this is my first app i wanted to check if im doing things right.
Is it ok to start running my code in the AppDelegate
method applicationDidFinishLaunching
or should i make another file my entry point. I read somewhere that im supposed to make a main.swift file but i havent found information about that.
Asked
Active
Viewed 310 times
1

Santiago Alvarez
- 167
- 1
- 12
-
It depends on the design of the app. Does it need a run loop or is a command line interface sufficient? – vadian Mar 10 '21 at 12:29
-
It is a Daemon that is supposed to run 24/7. The main functionality of the app is that is has a timer that makes a request to an api every couple of minutes – Santiago Alvarez Mar 10 '21 at 12:37
-
You can use both a faceless **app** and a command line interface (CLI) on the current run loop. I recommend the former. You have to specify the LSUIElement key in Info.plist. – vadian Mar 10 '21 at 12:47
-
Yeah i have set that in the plist. I was just asking wether it was correct to use AppDelegate as my entry point given that my app has no ui, no viewcontroller, etc – Santiago Alvarez Mar 10 '21 at 12:53
-
Yes, you can use `AppDelegate` as the entry point. – vadian Mar 10 '21 at 13:07