최신Apple App Development with Swift Certified User - App-Development-with-Swift-Certified-User무료샘플문제
문제1
Review the code.
var capitalCities = [ " USA " : " Washington D.C. " , " Spain " : " Madrid " , " Peru " : " Lima " ] Which two statements add the capital city of " Italy " to the dictionary? (Choose 2.)
Review the code.
var capitalCities = [ " USA " : " Washington D.C. " , " Spain " : " Madrid " , " Peru " : " Lima " ] Which two statements add the capital city of " Italy " to the dictionary? (Choose 2.)
정답: A,C
문제2
Which property wrapper allows you to read data from the system or device settings?
Which property wrapper allows you to read data from the system or device settings?
정답: A
설명: (KoreaDumps 회원만 볼 수 있음)
문제3
Complete the code that conforms to the View protocol by selecting the correct option from each drop-down list.
Note: You will receive partial credit for each correct answer.

Complete the code that conforms to the View protocol by selecting the correct option from each drop-down list.
Note: You will receive partial credit for each correct answer.

정답:

Explanation:

This question belongs to View Building with SwiftUI , especially the domain covering positioning and/or layout a single SwiftUI View with standard Views and modifiers and the foundational structure of a SwiftUI view. In SwiftUI, a custom screen is typically declared as a struct that conforms to the View protocol. Apple's SwiftUI documentation shows the standard pattern:
struct ScreenView: View {
var body: some View {
Text( " Hello " )
}
}
Here, struct is required because SwiftUI views are commonly defined as structures. View is required after the colon because the type must conform to the View protocol. body is the required computed property that returns the content of the view as some View. Apple documents that every conforming View type must provide a body property that describes its content.
So the completed code is:
import SwiftUI
struct ScreenView: View {
var body: some View {
Text( " Hello " )
}
}
This is the canonical SwiftUI view declaration pattern and is one of the most fundamental concepts in App Development with Swift.
문제4
Review the code snippet.

Move each item from the list on the left to the correct code segment on the right. You may use each item only once.
Note: You will receive partial credit for each correct response.

Review the code snippet.

Move each item from the list on the left to the correct code segment on the right. You may use each item only once.
Note: You will receive partial credit for each correct response.

정답:

Explanation:

This question belongs to Swift Programming Language , specifically the domain covering structs, properties, methods, and initializers .
A computed property does not store a value directly. Instead, it returns a value calculated from other data.
That is why description is a computed property: it returns a string based on content.
A memberwise initializer is automatically provided by Swift for structs when their stored properties are initialized through parameters. So Document(content: " Greetings! " ) is using the struct's memberwise initializer.
A type property belongs to the type itself rather than to an instance. In Swift, static var docCount = 0 is a type property because it is declared with static.
An instance method is a function that belongs to an instance of the struct or class. The display() method uses the instance's content, so it is an instance method.
A type method is a method declared with static and belongs to the type itself. So static func increment() is a type method because it changes the shared type property docCount.
문제5

Which two assignments of a value to direction are allowed? (Choose 2.)

Which two assignments of a value to direction are allowed? (Choose 2.)
정답: A,C
설명: (KoreaDumps 회원만 볼 수 있음)