Ans :
In mostly language, There is having main method in main file which is starting point of project. In iOS, also same approach are there.
Objective-C :
main.m File :
Swift :
AppDelegate.swift
In Swift, @UIApplicationMain attribute is a replacement of main.m file & and entry point for your application to start.
In mostly language, There is having main method in main file which is starting point of project. In iOS, also same approach are there.
Objective-C :
main.m File :
int main(int argc, char * argv[]) {
NSString * appDelegateClassName;
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.
appDelegateClassName = NSStringFromClass([AppDelegate class]);
}
return UIApplicationMain(argc, argv, nil, appDelegateClassName);
}
Swift :
AppDelegate.swift
import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
In Swift, @UIApplicationMain attribute is a replacement of main.m file & and entry point for your application to start.
No comments:
Post a Comment
Thanks