Module quiz: Getting Started with SwiftUI :Create the User Interface with SwiftUI (Meta iOS Developer Professional Certificate) Answers 2026
Question 1
Which is correct for how SwiftUI deals with user interfaces on different devices?
✅ Mobile devices have smaller interfaces compared to larger devices. Once you have created the elements you want to display, SwiftUI will decide how to display them.
❌ SwiftUI will render the same user interface for all devices and screen sizes.
Question 2
Which of these statements is correct?
❌ The button size is irrelevant. The only thing that we have to take into consideration is to make clear what the button will accomplish.
❌ Buttons must follow color consistency…
✅ Buttons for a touch interface must be larger than their counterparts for an interface controller by a mouse because fingers are big controller devices compared to a mouse pointer.
Question 3
Which of the following statements about Xcode are correct?
✅ Xcode is an app that allows the development of apps for all Apple platforms.
✅ Xcode provides a SwiftUI preview that is quite powerful and shows live views of the interface as you build.
❌ Xcode offers code editing and debugging but does not offer a way to preview interfaces as you build.
Question 4
Which is correct about SwiftUI?
❌ SwiftUI requires you to type more code compared to UIKit.
❌ SwiftUI comes to replace UIKit as a way to create user interfaces.
✅ SwiftUI provides ways to create fast app development.
Question 5
Which of the statements are true about Declarative, and Imperative syntaxes?
✅ Declarative Syntax lets you specify what you want to be created and the system decides how to do it.
✅ Imperative Syntax forces you to describe exactly how you want an interface item to be created.
❌ Declarative Syntax forces you to describe exactly how you want an interface item to be created.
Question 6
Which of the statements are true about SwiftUI syntax?
✅ SwiftUI uses Declarative Syntax.
❌ SwiftUI uses Imperative Syntax.
✅ In SwiftUI every view is a struct.
Question 7
What does a TextField need to operate correctly in SwiftUI?
❌ A TextField works on its own and provides the typing text inside a closure.
✅ A TextField needs a controlling variable of type @State to store and read values from.
Question 8
When connected to a @State variable, a TextField stores input in this variable and updates its values if the variable changes.
❌ False
✅ True
Question 9
Which one represents the correct syntax for a @State variable?
❌ @State var inputVariable: String = ""
❌ @State inputVariable: String = ""
✅ @State var inputVariable = ""
Question 10
Which do you need to do to pass a @State variable to another view?
❌ Nothing. @State variables are ready to be shared with another view and there is no additional code needed.
✅ We need to set up the receiving view with a @Binding.
🧾 Summary Table
| Question | Correct Answer(s) |
|---|---|
| Q1 | SwiftUI decides layout per device |
| Q2 | Touch buttons must be larger |
| Q3 | Xcode supports all Apple platforms + SwiftUI preview |
| Q4 | SwiftUI enables fast development |
| Q5 | Declarative (what), Imperative (how) |
| Q6 | Declarative syntax, Views are structs |
| Q7 | Needs @State variable |
| Q8 | True |
| Q9 | @State var inputVariable = "" |
| Q10 | Use @Binding |