What will be the result when I delete AppDelegate from project?
What's the use of AppDelegate in iOS project?
Is AppDelegate causes increase in memory size of .app?
What will be the result when I delete AppDelegate from project?
What's the use of AppDelegate in iOS project?
Is AppDelegate causes increase in memory size of .app?
The entry point for every C-based app is The Main Function and iOS apps are no different. What is different is that for iOS apps you do not write the main function yourself. Instead, Xcode creates this function as part of your basic project. With few exceptions, you should never change the implementation of the main function that Xcode provides.
The main function of an iOS app
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
The UIApplicationMain function ,hands control off to the UIKit framework , by creating the core objects of your app, loading your app’s user interface from the available storyboard files, calling your custom code so that you have a chance to do some initial setup, and putting the app’s run loop in motion.
The app delegate is the heart of your custom code. This object works in tandem with the UIApplication
object to handle app initialization, state transitions, and many high-level app events. This object is also the only one guaranteed to be present in every app, so it is often used to set up the app’s initial data structures.
Hence if we delete AppDelegate file from Xcode Project all above processes will be cease and hence app would not launch.
Check apple developer site for more info on App Life Cycle.
No you can't delete App-Delegate file, Its generated by X Code on project creation.Once you delete it this will not allow you to run your app.
There is no size increase by this App-Delegate file
You cant't run application without AppDelegate
Launch time is an important point in an app’s life cycle. At launch time, the app delegate is responsible for executing any custom code required to initialize your app. For example, the app delegate typically creates the app’s initial data structures, registers for any required services, and tweaks the app’s initial user interface based on any available data. Apple Doc