CertsPoint
See all results for ""
Exams About Us
Sign In Get Started
Exam Overview
Exam Code App-Development-with-Swift-Certified-User
Exam Name App Development with Swift Certified User Exam
Vendor Apple
Total Questions 40
Last Updated 26-Oct, 2026
Why CertsPoint?
  • Latest & Verified Questions
  • Detailed Explanations
  • Regular Updates
  • Full-Length Practice Tests
  • Boost Your Exam Confidence

PDF Study Materials

Downloadable guides and resources

Practice Tests

Full-length tests with real exam experience

Progress Tracking

Monitor your performance and improvement

Study Anywhere

Access on desktop, tablet, and mobile

Excellent
4.6 (398 Up Votes)
Secure Payment Privacy Protected Money Back Guarantee

Free App-Development-with-Swift-Certified-User Practice Questions

Explore 1 free practice question for the Apple App-Development-with-Swift-Certified-User exam and review the answers and explanations to support your preparation.

  1. Question 1

    Multiple answers

    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.)

    • Option A:
      capitalCities[ " Rome " ] = " Italy "
      Correct
    • Option B:
      capitalCities.append([ " Italy " : " Rome " ])
      Correct
    • Option C:
      capitalCities[ " Italy " ] = " Rome "
      Correct
    • Option D:
      capitalCities = capitalCities + [ " Italy " : " Rome " ]
      Correct
    • Option E:
      capitalCities.updateValue( " Rome " , forKey: " Italy " )
      Correct
    Show Answer & Explanation Hide Answer & Explanation

    Correct Answer: C, E

    Explanation

    Comprehensive and Detailed Explanation From App Development with Swift domains:
    This question falls under Swift Programming Language , specifically the domain for managing data using collection types , with emphasis on dictionaries . In Swift, a dictionary stores data as key value pairs , so in this example the country name is the key and the capital city is the value. To add a new entry, Swift supports two standard approaches. The first is subscript assignment , which is shown in option C : capitalCities[ " Italy " ] = " Rome " . Apple’s documentation explains that you can add a key-value pair to a dictionary by assigning a value for a new key through the dictionary subscript.
    The second correct approach is option E : capitalCities.updateValue( " Rome " , forKey: " Italy " ). Apple documents that updateValue(_:forKey:) updates the value for an existing key, or adds a new key-value pair if the key does not already exist . That makes it equally valid for inserting " Italy " : " Rome " into the dictionary.
    The incorrect options fail for different reasons. A reverses the key and value, making " Rome " the key and " Italy " the value. B is wrong because append is used with arrays, not dictionaries. D is not the standard valid insertion syntax for Swift dictionaries in this context; Swift’s documented mutation approaches here are subscript assignment and updateValue. Therefore, the two correct answers are C and E .