placeholder image to represent content

APPLE SWIFT PLAYGROUNDS

Quiz by Katherine McCoy

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
9 questions
Show answers
  • Q1
    In Apple Swift Playgrounds, what is the correct syntax to declare a constant?
    const
    define
    var
    let
    30s
  • Q2
    What is the purpose of a 'for-in' loop in Swift?
    To perform arithmetic operations
    To define a function
    To declare a variable
    To iterate over a sequence or collection
    30s
  • Q3
    Which keyword is used to define a function in Swift?
    method
    func
    def
    function
    30s
  • Q4
    What is the correct way to create an empty array in Swift?
    []
    nil
    ()
    {}
    30s
  • Q5
    What is the correct syntax to define a class in Swift?
    object
    class
    type
    struct
    30s
  • Q6
    What does the 'self' keyword refer to in Swift?
    The global scope
    A specific method
    An external object
    The current instance of a class or structure
    30s
  • Q7
    What is the correct syntax to print a message to the console in Swift?
    display()
    print()
    log()
    output()
    30s
  • Q8
    What is the correct syntax to add an element to the end of an array in Swift?
    push()
    insert()
    append()
    add()
    30s
  • Q9
    What is the purpose of a 'guard' statement in Swift?
    To define a class
    To exit a function, method, or loop if a condition is not met
    To perform mathematical calculations
    To declare a variable
    30s

Teachers give this quiz to your class