Swift (general) Flashcards
What is a UIEelement?
It’s an object class in the view controller (eg a button)
What is an @IBAction?
@IBActions are connected to UIElements (eg a button). They call code when the button is tapped. Connects ViewController (eg with button) to the code - eg button is controlling the code execution.
What is an @IBOutlet
@IBOutlets are connected to UIElements (eg button). They change the look of the UIElement (button) in the ViewController. Connects code to ViewController - eg the code changes the look of the button.
What is UINavigation Controller?
UINavigation Controller is a class that lets you navigate between different UIViewControllers (ie screens). It can handle a stack of different UIViewControllers (ie the screens). The first stack is called the rootViewController
What does AVFoundation framework do?
It deals with audio and video
eg AVAudio class
What is an AVAudioSession?
Need to record and playback audio. There’s just one that exists for the entire time the app is running. You grab it with the .sharedInstance() method - ie AVAudioSession.sharedInstance()
What does NSSearchPathForDirectoriesInDomains
Creates a list of directory search paths
What is delegation?
When you get one object to do the job of anothers
What is a gesture recogniser?
A subclass of UIGestureRecogniser that detects a specific touch sequence and calls an action on its target when the sequence is detected. eg pinch, swipe, tap
What is the scene dock?
It’s the row of icons above the canvas (ie ViewController)
What does ctrl + dragging from ViewController (yellow circle) to the UIElement (eg button) do?
It connects an @IBOutlet
What does ctrl + dragging from a UIElement (eg button) to the ViewController (yellow circle)?
It connects an @IBAction
What is a tag?
Found in the Attributes Inspector, a tag is an integer that you can use to identify View objects in your app
(Related method is -[UIView tag]
What is a framework?
A framework a shared library of of code that includes associated resources such as interface files and images (eg MKMapView) (can be added in xcode using imports UK for eg)
What is UITabBarController?
UITabBarController is an array of view controllers. It also has a tab bar at the bottom of the screen with a tab for each view controller in its array.
What is a function?
A function is a self contained piece of code that performs a specific task. The three types in swift are Global Functions, Nested Functions, and Methods