Ios - Intro
Ios - Intro
● iOS is a mobile operating system developed and distributed by Apple Inc. It was
originally released in 2007 for the iPhone, iPad, iPod Touch, and Apple TV, Apple
Watch etc.
● Objective-C is the main programming language used by Apple for the OS X and iOS
operating systems and their respective APIs, Cocoa and Cocoa Touch.
● Swift 5.1 is a new programming language developed by Apple Inc for iOS and OS X
development. Swift 5 adopts the best of C and Objective-C, without the constraints of
C compatibility.
● Cocoa and Cocoa Touch are the application development environments for OS X and
iOS, respectively.
● Cocoa, which includes the Foundation and AppKit frameworks, is used for developing
applications that run on OS X.
Getting into App(le) World
● Cocoa Touch, which includes Foundation and UIKit frameworks, is used for
developing applications that run on iOS.
● Swift 4 comes with playground feature where Swift 4 programmers can write their
code and execute it to see the results immediately.
● You need XCode software(IDE) to start your Swift 4 coding in Playground.
● Once you are comfortable with the concepts of Swift 4, you can use Xcode IDE for
iOS/OS X application development.
● An introduction about the App Bundle, Bundle Identifier, Provisioning Profiles,
Understanding plist files,
building and archiving the app.
MODEL VIEW CONTROLLER ARCHITECTURE
The view also represents the data from chats, diagrams, and table. For example, any
customer view will include all the UI components like text boxes, drop downs, etc.
● Controller
The Controller is that part of the application that handles the user interaction. The
controller interprets the mouse and keyboard inputs from the user, informing model and
the view to change as appropriate.
A Controller send's commands to the model to update its state(E.g., Saving a specific
document). The controller also sends commands to its associated view to change the
view's presentation (For example scrolling a particular document).
MODEL VIEW CONTROLLER ARCHITECTURE
MVC Examples
Example 1:
Let's assume you go to a restaurant. You will not go to the kitchen and prepare food which
you can surely do at your home. Instead, you just go there and wait for the waiter to come
on.
Now the waiter comes to you, and you just order the food. The waiter doesn't know who
you are and what you want he just written down the detail of your food order.
Then, the waiter moves to the kitchen. In the kitchen waiter not prepare your food.
The cook prepares your food. The waiter is given your order to him along with your table
number.
Cook then prepared food for you. He uses ingredients to cooks the food. Let's assume that
your order a vegetable sandwich. Then he needs bread, tomato, potato, capsicum, onion,
bit, cheese, etc. which he sources from the refrigerator
Cook final hand over the food to the waiter. Now it is the job of the waiter to moves this
food outside the kitchen.
Now waiter knows which food you have ordered and how they are served.
In this case,
View= You Waiter= Controller Cook= Model Refrigerator= Data
Example 2:
Getting on board with iOS can be intimidating. Either Swift nor Objective-C, the platform
has its own names for almost everything, and it's a bumpy road for your code to actually
make it onto a physical device. This living document is here to help you, whether you're
taking your first steps in Cocoaland or you're curious about doing things "the right way".
Everything below is just suggestions, so if you have a good reason to do something
differently, by all means go for it!
XCODE
● Inactive
The app is running in the foreground but is currently not receiving events. (It may be
executing other code
though.) An app usually stays in this state only briefly as it transitions to a different
state.
App Execution Stages
● Active
The app is running in the foreground and is receiving events. This is the normal mode for
foreground apps.
● Background
The app is in the background and executing code. Most apps enter this state briefly on their way to
being suspended. However, an app that requests extra execution time may remain in this state for
a period of time. In addition, an app being launched directly into the background enters this state
instead of the inactive state.
● Suspended
The app is in the background but is not executing code. The system moves apps to this state
automatically and does not notify them before doing so. While suspended, an app remains in
memory but does not execute any code.
When a low-memory condition occurs, the system may purge suspended apps without notice to make
more space for the foreground app.
XCODE