Skip to content

Module quiz: Advanced SwiftUI :Create the User Interface with SwiftUI (Meta iOS Developer Professional Certificate) Answers 2026

Question 1

Which of the following is the correct method for how SwiftUI creates Hierarchical Navigation systems?

Hierarchical Navigation can be created in SwiftUI by using the keywords navigationLink and navigationView.
❌ SwiftUI will render the same user hierarchical interface for all devices and screen sizes regardless of any particular code.

Explanation: SwiftUI me hierarchical navigation ke liye NavigationView + NavigationLink use hota hai.


Question 2

Which of these statements is correct?

❌ Flat Navigation systems are the ones where all screens are within reach and can be derived from the starting screen.
The Hierarchical Navigation, on the other hand, has multiple options inside the other. Imagine a list of products that shows details about every item, on a new view, once an item is selected.
NavigationLink is a special kind of element that is tappable, like a button.

Explanation: Hierarchical navigation nested structure hota hai, aur NavigationLink tappable hota hai.


Question 3

What are the main differences between Scrollview and List?

❌ ScrollView and List are static whose data cannot be changed.
Scrollview displays elements as they are, with barely any formatting.
❌ By default, ScrollView and List displays elements in a vertical orientation.

Explanation: ScrollView raw content dikhata hai, jabki List me default styling hoti hai.


Question 4

Which is correct about SwiftUI?

❌ SwiftUI requires you to type more code compared to UIKit.
SwiftUI provides ways to create fast app development.
❌ SwiftUI comes to replace UIKit as a way to create user interfaces.

Explanation: SwiftUI development fast banata hai, par UIKit ko fully replace nahi karta.


Question 5

Which of the following statements and / or code accurately displays or describes a gesture?

Text("Hello, World!")
.onGesture {
print("Long press Detected on the Text element!")
}

Text("Hello, World!")
.onTapGesture {
print("Text Tapped!")
}

A Gesture is an element that can be attached to a view and detect interactions from taps, clicks and swipes to fine-grained gestures.

Explanation: .onGesture valid modifier nahi hai, .onTapGesture correct hai.


Question 6

What is the following error code an example of?

❌ In SwiftUI, every view is a struct.
❌ This is not a real error code.
This happens because the elements in a ForEach loop that is processing cannot be distinguished from one other. (Every element must be unique in SwiftUI).

Explanation: ForEach ke elements ko uniquely identifiable hona zaroori hota hai.


Question 7

A List or Scrollview have a ten element limit.

False
✅ True

Explanation: Koi element limit nahi hoti List ya ScrollView me.


Question 8

The DragGesture allows you to drag a view around. It is a little bit more complex because it requires a variable for controlling the view’s position.

❌ False
True

Explanation: Drag gesture ke liye state variable chahiye hota hai.


Question 9

Which of the following is the correct parameter for the modifier onLongPressGesture?

❌ onPressingChanged
❌ maximumDistancePressed
minimumDuration

Explanation: onLongPressGesture(minimumDuration:) correct parameter hai.


Question 10

If you intend to detect long presses, what can you simply replace onTapGesture with?

onLongPressGesture
❌ Nothing.

Explanation: Long press detect karne ke liye .onLongPressGesture use hota hai.


🧾 Summary Table

Question Correct Answer(s)
Q1 NavigationView + NavigationLink
Q2 Hierarchical navigation description, NavigationLink tappable
Q3 ScrollView has minimal formatting
Q4 SwiftUI enables fast development
Q5 onTapGesture + gesture definition
Q6 ForEach elements must be unique
Q7 False
Q8 True
Q9 minimumDuration
Q10 onLongPressGesture