IOS Fundamentals & Data Persistence Flashcards
What are apps?
Apps are bundles of files, they’re individual items held together in a file and bundled.
What does swiftUI get rid of?
Storyboards
What is complied code that makes up an app formed of?
- Unique code
- frameworks
- info.plist configuration file
How do we get resources in IOS such as images, sounds etc?
By using asset libraries
When you create a swift program what does xcode automatically generate?
xcode automatically generates the basic files for a project of the selected type
Which file does main typically reference?
- AppDelegate.swift as this is the main entry point for your application
What are the two functions of the AppDelegate.swift source file?
- to create an entry point and run loop for your app (equiv to main() in programs)
- defines AppDelegate class which is the blueprint for an app. It creates window where app content is drawn. You write your custom app level code here
What does the app delegate do when you go into another app on your phone?
It keeps the previous app running in the background as it may need to complete some tasks/it may have more processing to do, such as storing information, before it completely terminates.
What is a Delegate?
code that provides some additional functionality by providing specific methods, which can be invoked when required by another class.
- Apple asks your delegate to do things on your behalf because it can only provide so much functionality. Your app is original, so you have to define what’s original about it by customising your delegate code.
What is an app Delegate?
- A single delegate object that provides specific methods to handle events that occur as part of the lifecycle of an App
- E.g. your App starting up. Your App’s window contents being drawn on the screen. Your App closing down. etc…
What does the ViewController.swift do?
This stores all the information about what’s displayed in our app
What type of code is placed in ViewController.swift
- IBOutlets (labels etc.) and IBActions (buttons)
- Class and Structure names start with A-Z
- Method names start a-z
What is UIKit?
- It defines the core components of an iOS application
- it’s specific to iOS (can’t be used for macOS for example)
- most UIKit classes can only be used from the app’s main thread
What is iInside a Swift iOS app
- It has a series of states pre-defined, those are still there but they have been moved to another file
- When you tap on an app on your phone, the process moves into the foreground
- When you then go into another app, the process transitions into the background, and finishing doing the processing it needs to before being suspended/terminated
What is delegation?
A design pattern where a host object embeds a “pointer” to another object (the delegate), and sends messages when input etc is required
What are the two required methods used in a tableView?
- number of rows
- number of sections in the table (if you don’t provide this it has a default of 1)
how does swift save memory and processing time when implementing tableViews?
Swift only draws out as many items as are visible on the screen to save memory space/processing time
- When the items we first drew up are no longer visible on the screen, they are disregarded.
-When tables are drawn, only the content on the screen is required from the delegate.
What are views?
they are rectangular areas on screen that handle events and display content
What are viewControllers?
They are special controllers that manage views?
What does the UIKit framework do?
- It defines the main layer of classes an application needs to construct and manage it’s interfaces
What are touch events?
- When the user touches the screen
- could be touchesBegan, touchesMoved, touchesEnded, touchedCancelled
- Touch events are a whole series of touch movements
What does the UIGestureRecogniser do?
It allows you to detect very gentle touches/motion on the screen such as a long press, a double tap or a swipe
What does the Navigation Bar allow you to do?
- Allows you to progress through a structure, giving more specific related detail on every next step of the hierarchical structure. For example Settings in IPhone.
- They use the screen the most effectively by hiding complexity from the user. Too many options on the page may confuse them.
What does the search Bar allow you to do?
- Used to search through a large collection of values
- prominent or minimal styles
- minimal search bars don’t expand until tapped on