iOS Flashcards
(48 cards)
What are the 4 Obj-C Data Types?
- Bool
- NSInteger
- NSUInteger
- NSString
Name 6 key features of Swift
- Type Safety
- Simplicity
- Readability
- Multiplatform support
- Open source
- Obj-C Compatible
What are the pieces that make up an NSError object?
- Error Domain
- Error Code
- Application specific user info
Explain what an Enum is
Variable with user defined values that can be used in a type safe way with switches and conditionals
What does the lazy keyword mean?
The property defined as lazy will not be computed until its called
What is a generic is swift?
A function or class that that does not infer type to allow for reusability
What does KVC mean and do?
Key value constant. Allows access of properties via string instead of property names
What does KVO mean and do?
Key Value Object: allows other objects to observe changes to the specified object
What are the 3 steps of Test Driven Development?
Fail
Pass
Refactor
What does a completion handler do?
Calls a function when a task completes
What are the 4 types of queues?
Dispatch
Serial Dispatch
Concurrent Dispatch
Main Dispatch
What does a dispatch queue do?
A dispatch queue is responsible for executing a task in the first-in, first-out order.
What does a serial dispatch queue do?
A serial dispatch queue runs tasks one at a time.
What does a concurrent dispatch queue do?
A concurrent dispatch queue runs as many tasks as it can without waiting for the started tasks to finish.
What’s does the main dispatch queue do?
A globally available serial queue that executes tasks on the application’s main thread.
What are 6 types of pattern matching in Swift?
Tuple pattern Type Casting Wildcard Optional Enumeration Expression
What is tuple pattern matching?
used to match values of corresponding tuple types.
What is type-casting pattern matching?
allow you to cast or match types
What is wildcard pattern matching?
match and ignore any kind and type of value
What is optional pattern matching?
used to match optional values
What is enumeration pattern matching?
match cases of existing enumeration types.
What is expression pattern matching?
allow you to compare a given value against a given expression.
What are 3 benefits of guard statements?
- Safely unwrap optionals
- Avoid if let pyramids
- Provides an early exit of the function
Name 3 debugging tools in Xcode
- View debugger
- Thread sanitizer
- Memory graph debugger