Now we know how to write a Simple Hello World Application in Swift Programming language. As shown in the below image, for Single View application would have created multiple files in your project navigator. What are those files for ? Lets see..
Project Navigator displays all the files related to the project, if it is not visible, click the left top marked - project Navigator icon.
Now lets look into those files in detail.
- It Stands as an entry point to your application
- It delivers input events by running a loop
- @UIApplicationMain Atrribute is responsible for above functions.
- This attribute is also responsible to manage lifecyle of the application
- App Delegate contains Single Property: Window , which is used to keep track of the window in which app content is drawn, but this is an optional property
var window: UIWindow?
- Apart from these appdelegate also contains implementation of important methods. These methods
During app transition, appropriate methods in the app delegate are invoked by the application object.
- This file defines a custom subclass of UIViewController named ViewController
- This class simply inherits all the behavior defined by UIViewController.
- To override or extend that behavior, you override the methods defined on UIViewController or implement your own custom methods.
- A storyboard is a visual representation of the app’s user interface, showing screens of content and the transitions between them.
- Xcode opens the storyboard in Interface Builder—its visual interface editor—in the editor area
- You can add label, Textbox or what ever controls required to build your app
- Below is a story with a label on it.
Hope you got to know the below listed information or answers to these question.
- What does appdelegate swift do
- What does ViewController swift do
- Storyboard in swift
- Single View application project files
Hope this tutorial helps you to understand Single View applcation Project files in Swift language.