Font size
WorksheetsSwift playground - about me module
Total questions: 16
Worksheet time: 13mins
What is a property in Swift?
A function that performs an action
A variable that describes an attribute of an object
A type of loop used in coding
A keyword used to import modules
Which code would you use to change the background color of your profile?
.foregroundColor(.blue)
.background(.blue)
.color(.blue)
.font(.blue)
What Swift feature allows you to add emojis or special characters to your profile?
Text
Image
Symbol
Shape
ZStack is used to layer views on top of each other in Swift Playgrounds.
TRUE
FALSE
During a group project, Maya used the (a) component to arrange elements horizontally on the presentation slide.
Which component is used to group views in a vertical layout?
HStack
VStack
ZStack
GridStack
Michael is learning Swift Playgrounds and wants to change the color of the text in his project. Which property should he use to achieve this?
.font
.color
.foregroundColor
.textColor
What does the padding( ) modifier do?
Changes the background color
Adds space around an element
Centers the element
Aligns text to the left
Which of these modifiers is used to add a border to a shape?
.outline( )
.frame( )
.border( )
.stroke( )
What happens when you combine multiple stacks (HStack, VStack, ZStack) in a Swift Playgrounds project?
The layout breaks and throws an error.
Only the first stack is rendered, and others are ignored.
You can create complex, layered designs with precise control over spacing and alignment.
The stacks automatically align based on screen size.
The (a) modifier is used to crop a view into a specific shape, such as a circle or a rounded rectangle.
The . (a) ( ) modifier adjusts the transparency of a view.
When working with a ZStack, the (a) element in the code will appear at the bottom.
Which combination of modifiers is best for creating a circular profile picture?
.frame(width: 100, height: 100) + .cornerRadius(50) + .shadow( )
.frame(width: 100, height: 100) + .clipShape(Circle( )) + .shadow( )
.frame(width: 100, height: 100) + .background(.white) + .padding( )
.frame(width: 100, height: 100) + .border(.black) + .cornerRadius(50)
What is the purpose of the .clipShape( ) modifier in Swift Playgrounds?
To crop the view into a specific shape, such as a circle or rectangle
To add padding around the view
To create a shadow effect around the view
To align the view within a stack
Write code to create a VStack displaying a title "Hello, World!" in bold and a subtitle "Welcome to Swift Playgrounds" in italic below it.
