10 exam-style questions with answers and explanations, straight from our 1,030-question bank. Tap an answer to check yourself. When you're ready, take the scored version in the free practice test.
These 10 free ADSU questions are organized by exam domain, so you can see how each part of the App Development with Swift Certified User blueprint is tested. Reveal the answer and explanation under each question.
Domain 1: Xcode Developer Tools
Question 1
In Interface Builder, a label has required width, height, and horizontal-center constraints. Its container has a fixed frame, autoresizing-mask translation is disabled, and no other constraints position the label. The label could occupy several vertical positions without violating any constraint. How should this problem be classified and repaired?
Show answer & explanation
Correct answer: D - Ambiguous layout; add a constraint that determines the vertical position.
Question 2
During an unoptimized Xcode debug run, a cart's stored item count changes unexpectedly from 6 to 0. Several functions could write it. Execution is currently paused while the count is still 6, and LLDB can watch its stable storage address throughout the relevant code. The developer needs to catch the write and inspect its call stack, rather than discover the changed value during a later screen refresh. What should be configured before execution resumes?
Show answer & explanation
Correct answer: A - A write watchpoint on the stored item count.
Domain 2: Swift Programming Language
Question 3
A progress display expects a percentage from 0.0 to 100.0. Its log reports 0.0 even though five of eight tasks are complete:
let completed = 5
let total = 8
let percent = Double(completed / total) * 100.0
print(percent)
Replace only the initializer of percent. Which expression retains fractional progress and reports 62.5?
Show answer & explanation
Correct answer: D - Double(completed) / Double(total) * 100.0
Question 4
An incident-response app crashes when its alert list becomes empty. Priority 1 means critical. This function must return false for an empty list and otherwise report whether the first alert is critical, without accessing an invalid index:
func firstAlertIsCritical(_ priorities: [Int]) -> Bool {
return priorities[0] == 1 && !priorities.isEmpty
}
Only the returned expression may change. Select the repair that satisfies both cases.
Show answer & explanation
Correct answer: A - !priorities.isEmpty && priorities[0] == 1
Question 5
A configuration parser accepts an integer only when the supplied value is a String that can be parsed as an Int. For example, the String "24" is accepted, but the Int 24 and the String "many" must return nil. None of those inputs may cause a runtime failure.
func parseCount(_ raw: Any) -> Int? {
// Insert the function body here.
}
Which body implements this contract?
Show answer & explanation
Correct answer: C - guard let text = raw as? String else { return nil }
return Int(text)
Question 6
A developer copies a card before editing it, expecting the saved card to remain unchanged in every respect:
final class Badge {
var text: String
init(text: String) { self.text = text }
}
struct Card {
var title: String
var badge: Badge
}
let saved = Card(title: "Draft", badge: Badge(text: "New"))
var editing = saved
editing.title = "Ready"
editing.badge.text = "Seen"
print(saved.title, saved.badge.text)
What does the final line reveal?
Show answer & explanation
Correct answer: C - Draft Seen
Question 7
The caption helper below is already part of an app:
func caption(_ title: String, for category: String,
emphasized: Bool = false) -> String {
return emphasized ? "[\(category)] \(title)!" : "[\(category)] \(title)"
}
Which invocation compiles and returns exactly [Travel] Kyoto, with no exclamation mark?
Show answer & explanation
Correct answer: A - caption("Kyoto", for: "Travel")
Domain 3: View Building with SwiftUI
Question 8
After a text field is extracted into TitleEditor, typing changes the field but not the title displayed above it. ProjectScreen must remain the owner of the editable title.
import SwiftUI
struct TitleEditor: View {
@State var title: String
var body: some View {
TextField("Project title", text: $title)
}
}
struct ProjectScreen: View {
@State private var title = "Harbor"
var body: some View {
VStack {
Text(title)
TitleEditor(title: title)
}
}
}
Which pair of changes restores that connection?
Show answer & explanation
Correct answer: B - Declare @Binding var title: String in TitleEditor; pass $title from ProjectScreen.
Question 9
A SwiftUI badge needs 12 points of blue space around its text, followed by 6 points of space outside the blue background. The parent provides sufficient room and adds no background of its own. Choose the modifier chain that matches the design.
Show answer & explanation
Correct answer: B - Text("Ready").padding(12).background(Color.blue).padding(6)
Question 10
A SwiftUI notes list uses List(notes, id: \.title). Each note also has a stored Int property named id that is unique and remains unchanged when the note is renamed or reordered. Users are allowed to give two notes the same title. Which revision preserves both the product requirement and reliable row identity?
Show answer & explanation
Correct answer: C - Use List(notes, id: \.id), preserving each stored ID when a title changes.
That's 10 of 1,030
The full bank has 1,020 more ADSU questions with explanations.