Browse Questions
  • CI/CD automates building, testing, and distributing your app on every code push.
  • - Serial queue — executes tasks one at a time, in order.
  • Yes — passing an observed property as inout always calls both willSet and didSet, even if the function never modifies the value.
  • LLDB is the debugger built into Xcode.

Answer:

  • Serial queue — executes tasks one at a time, in order. Second task waits for first to finish.
  • Concurrent queue — executes multiple tasks simultaneously on different threads.

Code Example:

// Serial queue — tasks run one after another
let serialQueue = DispatchQueue(label: "com.app.serial")
serialQueue.async { print("Task 1") }
serialQueue.async { print("Task 2") }  // always after Task 1

// Concurrent queue — tasks run in parallel
let concurrentQueue = DispatchQueue(label: "com.app.concurrent",
                                    attributes: .concurrent)
concurrentQueue.async { print("Task A") }
concurrentQueue.async { print("Task B") }  // may run before Task A

// Global queues are concurrent with different priorities
DispatchQueue.global(qos: .userInitiated).async { ... }
DispatchQueue.global(qos: .background).async { ... }

// Main queue is serial — always use for UI updates
DispatchQueue.main.async {
    self.tableView.reloadData()
}