App Development with Swift Certified User — Questions and Answers
Question 1: Which tool distributes beta builds of an iOS app to testers before App Store release?
- Swift Package Manager
- Xcode Cloud
- TestFlight (Correct answer)
- CocoaPods
Correct answer: TestFlight
TestFlight distributes pre-release builds to internal and external testers.
Question 2: What type of devices can run apps created with Swift?
- Mac devices
- Android devices
- OS X devices
- IOS devices dating back to iOS 7 or later (Correct answer)
Correct answer: IOS devices dating back to iOS 7 or later
Swift was introduced by Apple in 2014, and apps built with Swift can target a wide range of iOS devices. Specifically, Swift applications are compatible with iOS 7 and later versions, allowing developers to reach a broad user base even on slightly older hardware, as long as the device supports the minimum iOS version required by the app.
Question 3: What is a Swift enum with associated values used for?
- Replacing classes with value semantics
- Storing additional data alongside each case (Correct answer)
- Creating value types with methods only
- Defining protocol requirements
Correct answer: Storing additional data alongside each case
Swift enums with associated values allow each case to store custom associated data of specified types.
Question 4: Which protocol must a type conform to so SwiftUI's ForEach can uniquely identify its items without an explicit id?
- CaseIterable
- Comparable
- Equatable
- Identifiable (Correct answer)
Correct answer: Identifiable
Identifiable provides a stable id property that ForEach uses to track items.
Question 5: What type of problem does the Memory Graph Debugger in Xcode primarily help identify?
- Retain cycles and memory leaks (Correct answer)
- Frame rate drops in animations
- CPU usage spikes
- Network latency issues
Correct answer: Retain cycles and memory leaks
The Memory Graph Debugger visualizes object reference graphs to help find retain cycles that prevent deallocation.
Question 6: What does a segue represent in a UIKit storyboard?
- A unit test case
- A network request
- A transition between view controllers (Correct answer)
- A data model
Correct answer: A transition between view controllers
A segue defines a transition or relationship between two view controllers in a storyboard.
Question 7: To avoid a retain cycle in a closure capturing self, which capture list is commonly used?
- [mutable self]
- [strong self]
- [copy self]
- [weak self] (Correct answer)
Correct answer: [weak self]
[weak self] breaks the strong reference cycle by capturing self weakly.
Question 8: Which SwiftUI container arranges views horizontally side by side?
- VStack
- HStack (Correct answer)
- Grid
- ZStack
Correct answer: HStack
An HStack arranges its child views horizontally.
Question 9: Which UIKit class is used to display a scrollable list of items?
- UIStackView
- UICollectionView
- UIScrollView
- UITableView (Correct answer)
Correct answer: UITableView
UITableView displays data in a single-column scrollable list with rows organized into optional sections.
Question 10: What does the 'func' keyword do in Swift?
- Imports a framework
- Declares a class
- Declares a function (Correct answer)
- Creates a loop
Correct answer: Declares a function
The 'func' keyword is used to define a function in Swift.
Question 11: Which symbol is used to mark a type as Optional in Swift?
- !
- &
- ? (Correct answer)
- *
Correct answer: ?
A trailing question mark (e.g., String?) marks a type as Optional.
Question 12: Which SwiftUI modifier creates a visual animation when state changes?
- .animate(duration:)
- .transition(_:)
- .animation(_:value:) (Correct answer)
- .withAnimation(_:)
Correct answer: .animation(_:value:)
The `.animation(_:value:)` modifier automatically animates changes to the specified value using the given animation curve.
Question 13: In UIKit, what manages a single screen of content and its views?
- UIApplication
- UIView
- UIViewController (Correct answer)
- UIScene
Correct answer: UIViewController
A UIViewController manages a view hierarchy for one screen of an app.
Question 14: What framework does Apple provide natively for unit testing in iOS apps?
- XCTest (Correct answer)
- JUnit
- TestNG
- Mocha
Correct answer: XCTest
XCTest is Apple's built-in testing framework for writing unit, integration, and UI tests in iOS.
Question 15: Which SwiftUI modifier removes a view from the layout when a condition is false?
- .opacity(0)
- .hidden()
- if condition inside the view body (Correct answer)
- .disabled(true)
Correct answer: if condition inside the view body
Using an `if` statement in SwiftUI's view body conditionally includes or excludes a view from the layout entirely.
Question 16: What does `@escaping` mean on a closure parameter in Swift?
- The closure cannot capture self
- The closure can be stored and called after the function returns (Correct answer)
- The closure runs synchronously
- The closure throws errors
Correct answer: The closure can be stored and called after the function returns
An `@escaping` closure is allowed to outlive the function it was passed into, commonly used for async callbacks.
Question 17: Which iOS API is used to store small files in the app's sandboxed file system?
- URLSession
- NSCache
- FileManager (Correct answer)
- CoreFoundation
Correct answer: FileManager
FileManager provides an interface to the file system, allowing apps to create, read, write, and delete files within their sandbox.
Question 18: Which tool in Xcode is used to profile performance and detect memory leaks?
- Asset Catalog
- Instruments (Correct answer)
- Simulator
- Interface Builder
Correct answer: Instruments
Instruments is Xcode's profiling tool for analyzing performance and memory.
Question 19: Which SwiftUI container arranges its child views vertically?
- List
- ZStack
- HStack
- VStack (Correct answer)
Correct answer: VStack
A VStack stacks its child views vertically.
Question 20: What problem does a 'weak' reference help prevent in Swift?
- Threading deadlocks
- Slow rendering
- Retain cycles (strong reference cycles) (Correct answer)
- Compile errors
Correct answer: Retain cycles (strong reference cycles)
A weak reference avoids retain cycles by not increasing the reference count of the referenced object.
Question 21: Which IDE is used to develop, build, and submit iOS apps?
- Android Studio
- Xcode (Correct answer)
- Visual Studio
- Eclipse
Correct answer: Xcode
Xcode is Apple's official integrated development environment for building and submitting iOS apps.
Question 22: In Swift, which collection type stores ordered values accessed by index?
- Array (Correct answer)
- Dictionary
- Tuple
- Set
Correct answer: Array
An Array stores an ordered collection of values accessed by index.
Question 23: Which SwiftUI view displays a scrollable list from a collection?
- List (Correct answer)
- LazyVStack
- ForEach
- ScrollView
Correct answer: List
`List` is SwiftUI's declarative component for displaying a scrollable, structured list of rows from a collection.
Question 24: Which actor type in Swift concurrency guarantees its code runs on the main thread?
- GlobalActor
- UIActor
- MainActor (Correct answer)
- TaskActor
Correct answer: MainActor
@MainActor ensures the annotated code executes on the main thread, ideal for UI updates.
Question 25: What tool lets you test an iOS app on a virtual device without a physical iPhone?
- VirtualBox
- Simulator (Correct answer)
- Genymotion
- Emulator Pro
Correct answer: Simulator
The iOS Simulator, built into Xcode, runs apps on virtual Apple devices.
Question 26: What is Multipart/form-data used for in iOS networking?
- Uploading files and binary data alongside form fields in an HTTP request (Correct answer)
- Batching multiple API requests
- Encoding JSON with nested arrays
- Compressing HTTP response bodies
Correct answer: Uploading files and binary data alongside form fields in an HTTP request
Multipart/form-data is an HTTP content type for sending files or binary data mixed with form text fields in a single request body.
Question 27: What kind of app can be created using Xamarin?
- A Windows Phone app
- Universal Windows Platform app
- A Windows 8 app
- Cross-platform native (Correct answer)
- Windows Store app
Correct answer: Cross-platform native
Xamarin is a Microsoft-owned framework that allows developers to build cross-platform applications for iOS, Android, and Windows using C# and the .NET framework. Crucially, Xamarin compiles the C# code into native UI and API calls, resulting in apps that perform and look like native applications on each platform, rather than web-based or hybrid apps.
Question 28: Which approach should you use to schedule repeated background work like data refresh on iOS?
- Timer with sleep
- Blocking URLSession
- BackgroundTasks framework (Correct answer)
- A while loop on the main thread
Correct answer: BackgroundTasks framework
The BackgroundTasks framework lets the system schedule app refresh and processing tasks efficiently.
Question 29: Which Apple framework is the newer, declarative way to build user interfaces?
- UIKit
- WatchKit
- SwiftUI (Correct answer)
- AppKit
Correct answer: SwiftUI
SwiftUI is Apple's modern declarative UI framework introduced in 2019.
Question 30: What is the purpose of the Info.plist file in an iOS app?
- Renders the UI
- Stores app configuration and metadata (Correct answer)
- Holds user passwords
- Contains the app's source code
Correct answer: Stores app configuration and metadata
Info.plist stores key configuration values and metadata about the app.
Question 31: Which Apple framework handles networking tasks like downloading data over HTTP?
- AVFoundation
- CoreGraphics
- MapKit
- URLSession (Correct answer)
Correct answer: URLSession
URLSession is the standard API for making network requests in iOS.
Question 32: In UIKit, which class is the base for most on-screen visual elements?
- UIScreen
- UIWindowScene
- UIController
- UIView (Correct answer)
Correct answer: UIView
UIView is the fundamental building block for UI elements in UIKit.
Question 33: What app will the testers install to interact with your app?
- Apple App Store
- Google Play Test
- Google Play Test
- TestFlight (Correct answer)
- Firebase
Correct answer: TestFlight
TestFlight is Apple's official platform for beta testing iOS, watchOS, and tvOS apps. Developers invite testers to download and install the TestFlight app on their devices, which then allows them to install and test pre-release versions of the developer's app. This app facilitates feedback collection and crash reporting from the testers.
Question 34: What is a `ViewModifier` in SwiftUI?
- A protocol for creating animated transitions
- A protocol for drawing custom shapes
- A reusable type that applies a set of modifications to any view (Correct answer)
- A wrapper that adds gesture support to a view
Correct answer: A reusable type that applies a set of modifications to any view
`ViewModifier` is a protocol that lets you encapsulate a group of view modifications into a named, reusable struct.
Question 35: What OS does Xcode run on?
- GNU/Linux
- Mac OS X (Correct answer)
- Linux
- Microsoft Windows
- iOS
Correct answer: Mac OS X
Xcode is an exclusive development tool for Apple's ecosystem. It is designed to run specifically on macOS (formerly Mac OS X) and cannot be natively installed or run on other operating systems like Windows or Linux. This ensures a tightly integrated development experience within the Apple environment.
Question 36: What does pagination in a REST API solve?
- Authenticates requests with page-scoped tokens
- Limits the number of items returned per request to avoid large payloads (Correct answer)
- Caches responses by page number
- Compresses response data into pages
Correct answer: Limits the number of items returned per request to avoid large payloads
Pagination breaks large datasets into smaller chunks, reducing response payload size and server load for each request.
Question 37: How does SwiftUI handle navigation in iOS 16+?
- Manual view swapping with @State
- UINavigationController wrapping
- NavigationView with EmptyView destinations
- NavigationStack with navigationDestination modifier (Correct answer)
Correct answer: NavigationStack with navigationDestination modifier
In iOS 16+, `NavigationStack` combined with the `.navigationDestination(for:destination:)` modifier handles type-safe, programmatic navigation.
Question 38: Which keyword declares a variable that can be changed later in Swift?
- var (Correct answer)
- mutable
- let
- dynamic
Correct answer: var
The 'var' keyword declares a mutable variable in Swift.
Question 39: In Swift, what is an optional?
- A compile-time constant
- A type that may hold a value or be nil (Correct answer)
- A type that is always non-nil
- A reference-only type
Correct answer: A type that may hold a value or be nil
An optional represents a value that may be present or absent (nil).
Question 40: Which iOS framework is used to make HTTP network requests?
- NSURLConnection
- CFNetwork
- Alamofire
- URLSession (Correct answer)
Correct answer: URLSession
URLSession is Apple's modern, built-in framework for performing HTTP and HTTPS requests, downloads, and uploads.
App Development with Swift Certified User
The Apple App Development with Swift Certified User exam tests knowledge of Swift programming, Xcode, UIKit/SwiftUI, and core iOS app development concepts. It validates foundational skills in building, debugging, and deploying iOS applications.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds