iOS Apprentice Flashcards
What happens when you press Run?
The compiler is the part of Xcode that converts your Swift source code into executable binary code
The complete set of frameworks for iOS is known collectively as?
Cocoa Touch
With what UIKit works to represente size on screen
Points
Three possible scope levels in Swift
Global scope: These objects exist for the duration of the app and are accessible from anywhere.
Instance scope: This is for variables such as currentValue. These objects are alive for as long as the object that owns them stays alive.”
“Local scope: Objects with a local scope, such as the slider parameter of sliderMoved(), only exist for the duration of that method. As soon as the execution of the program leaves this method, the local objects are no longer accessible.”
What is info.plist?
Info.plist is a configuration file inside the application bundle that tells iOS how the app will behave. It also describes certain characteristics of the app, such as the version number, that don’t really fit anywhere else.
What happens if you don’t add any constraints to your views?
In that case, Xcode will automatically add constraints when it builds the app.”
In order to allow Xcode to put an app on your iPhone?
the app must be digitally signed with your Development Certificate. A certificate is an electronic document that identifies you as an iOS application developer and is valid only for a specific amount of time.
Apps that you want to submit to the App Store must
be signed with the Distribution Certificate.
Xcode uses this to sign the app for use on your particular device (or devices)
Provisioning Profile
you need a provisioning profile or the app won’t go on your device.
What the difference is between the terms property and instance variable?
In Swift terminology, a property is a variable or constant that is used in the context of an object. That’s exactly what an instance variable is.
(In Objective-C, properties and instance variables are closely related but not quite the same thing. In Swift they are the same.)”
Cleaning code flow
When write code until it becomes messy and then you clean it up. After a little while it becomes a big mess again and you clean it up again.
NSRange vs. Range
NSRange is an Objective-C structure whereas Range is its Swift equivalent - they are similar, but not exactly the same. So, while an NSRange parameter is used by the UITextField (which internally, and historically, is Objective-C based) in its delegate method, in our Swift code, if we wanted to do any String operations, such as replacingCharacters, then we need a Range value instead. Swift methods generally use Range values and do not understand NSRange values, which is why we converted the NSRange value to a Swift-understandable Range value.
Segue flow in steps

Equal vs identical
If you use ==, you’re checking whether two variables have the same value.”
“With === you’re checking whether two variables refer to the exact same object.
UInt vs Int
The U stands for unsigned, meaning the data type can hold positive values only. It’s called unsigned because it cannot have a negative sign (-) in front of the number.
CGFloat vs Float
CGFloat. This isn’t really a Swift type but a type defined by the iOS SDK. It’s a decimal point number like Float and Double. For historical reasons, this is used throughout UIKit for floating-point values. (The “CG” prefix stands for the Core Graphics framework.)
%f vs %.8f
The .8 means that there should always be 8 digits behind the decimal point.
UI objects hierarchy from NSObject

assert() in code
An assertion is a special debugging tool that is used to check that your code always does something valid. If not, the app will crash with a helpful error message.
Assertions are usually enabled only while you’re developing and testing your app and disabled when you upload the final build of your app to the App Store
Unwind segue
Unwind segue closes the active scree
Mutating keyword
When a method changes the value of a struct, it must be marked as mutating. Recall that String is a struct, which is a value type, and therefore cannot be modified when declared with let.
You don’t need to use the mutating keyword on methods inside a class because classes are reference types and can always be mutated, even if they are declared with let
“appearance proxy”
to change the look of all of the controls of a particular type at once.”
common technique for building complex layouts
Grouping views in a container view
Associated values in enums
They let you associate a custom value (or values) with each enumeration case.
- Each enumeration case has zero or more associated values.
- The associated values for each enumeration case have their own data type.
- You can define associated values with label names like you would for named function parameters.





