I want to execute a code snippet when program start-up, so what is the start-up function of iOS program?
For Android program, the start-up function is onCreate as below
public class HelloWorld extends Activity {
public void onCreate(Bundle savedInstanceState) {
...
How about iOS program?
Thanks
In iOS you use the UIApplicationDelegate protocol in order to be informed of application lifecycle events (startup, suspend, shutdown, etc.):
Assuming that you are using XCode for your iOS project, it will have created a default
UIApplicationDelegateclass for you. All you need to do is find it and edit theapplication:didFinishLaunchingWithOptions:method to your liking.