iOS

SwiftUI Basics

SwiftUI views, modifiers, stacks, lists, ForEach, state basics, composition

18 câu hỏi phỏng vấn·
Mid-Level
1

What primarily characterizes SwiftUI's declarative approach compared to UIKit?

Câu trả lời

SwiftUI uses a declarative approach where the desired state of the interface is described rather than implementing imperative steps to modify it. This fundamental difference allows automatic synchronization between data and display, reducing complexity and state management bugs.

2

Which protocol must every SwiftUI view conform to?

Câu trả lời

The View protocol is the foundation of SwiftUI. Every UI component must conform to it and provide a 'body' property returning the hierarchical interface description. This protocol conformance allows SwiftUI to manage the view lifecycle and updates.

3

What is the primary role of modifiers in SwiftUI?

Câu trả lời

Modifiers transform and configure views by applying changes to their visual, behavioral, or layout properties. They work in chains and return a new modified view rather than modifying the original. This preserves immutability and facilitates composition.

4

Which property wrapper manages local view state?

5

Which container combines multiple views horizontally in SwiftUI?

+15 câu hỏi phỏng vấn

Nắm vững iOS cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí