Desgin

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/61

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 5:47 PM on 4/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

62 Terms

1
New cards

What is a String in Swift?

A data type used for text. Any value written inside "quotation marks" — e.g. let profileName: String = "AppDesigner10"

2
New cards

What is an Int in Swift?

A data type used for whole numbers (no decimals). Best for counting items — e.g. var followerCount: Int = 150

3
New cards

What is a Double in Swift?

A data type used for decimal numbers. Best for precision or money — e.g. var averageRating: Double = 4.7

4
New cards

What is a Bool in Swift?

A data type used for True or False values — either true or false. Think of it like a light switch (on or off) — e.g. var isVerified: Bool = true

5
New cards

What are the four main data types in Swift?

String (text), Int (whole numbers), Double (decimal numbers), Bool (true/false).

6
New cards

What is the full syntax for declaring a variable with a type annotation in Swift?

keyword name: Type = value — e.g. let profileName: String = "AppDesigner10" or var followerCount: Int = 150

7
New cards

What is the difference between let and var in Swift?

let declares a constant — the value can never change after it is set. var declares a variable — the value can be updated at any time.

8
New cards

When should you use let?

When the value should never change — e.g. an app name, a username, a year joined, or a daily step goal.

9
New cards

When should you use var?

When the value will change over time — e.g. a follower count, a score, a height, or a notification setting.

10
New cards

What is camelCase and when is it used in Swift?

A naming convention where the first word is all lowercase and each following word starts with a capital letter, with no spaces — e.g. followerCount, isDarkMode, userBio. Always used for variable and constant names in Swift.

11
New cards

What are the three self-check questions before declaring a variable?

1) Should the value never change? Use let. 2) Will the value change? Use var. 3) Does the name start lowercase with no spaces (camelCase)?

12
New cards

What is a data model in app development?

A plan that defines exactly what data your app needs to track, store, and display — developers create this before building any screens.

13
New cards

What is a View in SwiftUI?

Everything visible on screen is a View — text, images, buttons, and whole screens are all views that can be combined together.

14
New cards

What is View Composition in SwiftUI?

The process of building complex screens by nesting small, simple views inside each other, rather than writing one giant messy screen.

15
New cards

What is a VStack?

A container view that arranges its child views Vertically — top to bottom.

16
New cards

What is an HStack?

A container view that arranges its child views Horizontally — left to right.

17
New cards

What is a ZStack?

A container view that layers its child views on top of each other by Z-index (depth), like stacking pieces of paper.

18
New cards

Which stack would you use to place an icon and a label side by side in a row?

HStack — it arranges items horizontally, left to right.

19
New cards

Which stack would you use to place a title above a subtitle?

VStack — it arranges items vertically, top to bottom.

20
New cards

What does .font(.headline) do in SwiftUI?

Applies a bold, larger headline style to a Text view — used for primary titles.

21
New cards

What does .font(.subheadline) do in SwiftUI?

Applies a smaller, secondary text style to a Text view — used for supporting details below a headline.

22
New cards

What is semantic layout in SwiftUI?

Describing the position of elements by their intent (e.g. "leading") rather than fixed pixel values, so layouts adapt correctly across different languages and screen sizes.

23
New cards

What does "Leading" mean in SwiftUI layout?

The start of the view — in English this is the left side. In right-to-left languages it would be the right side.

24
New cards

What does "Trailing" mean in SwiftUI layout?

The end of the view — in English this is the right side.

25
New cards

What is Padding in SwiftUI?

Invisible breathing room added around a view so it does not touch the edges of the screen or other views. Added with .padding()

26
New cards

What is Alignment in SwiftUI?

How items inside a stack line up relative to each other — e.g. VStack(alignment: .leading) lines all children up along the left edge.

27
New cards

How do you add padding only on one side in SwiftUI?

Use .padding(.bottom, 10) or .padding(.leading) etc. — specify the side and optionally the amount in points.

28
New cards

What is the ContentView structure in SwiftUI?

The main file of a SwiftUI app. It contains a struct conforming to View with a body property that returns the layout of the screen.

29
New cards

How do you add an image from the Resources folder in SwiftUI?

Use Image("filename") — e.g. Image("cat"). The image file must be added to the Resources folder in Swift Playgrounds first, with a short lowercase filename and no spaces.

30
New cards

What modifiers are used to make an image circular and sized correctly in SwiftUI?

.resizable(), .scaledToFit(), .frame(width: 200, height: 200), .clipShape(Circle()) — applied in that order after Image("filename").

31
New cards

What does .foregroundColor(.gray) do in SwiftUI?

Changes the text colour to gray — commonly used for captions or secondary text.

32
New cards

What is an if statement in Swift?

A decision-maker that checks if a condition is true and runs a block of code if it is. If the condition is false, the else block runs instead.

33
New cards

What is an else statement in Swift?

The "Plan B" block of code that runs when the if condition is false — ensures the user always gets a response from the app.

34
New cards

When should you use an if-else statement?

When your app has two possible paths — e.g. if a user is logged in, show their profile; else show the sign-up screen.

35
New cards

What does the == operator do in Swift?

Checks if two values are exactly equal — e.g. if score == 100. Used for comparison, not assignment.

36
New cards

What does the != operator do in Swift?

Checks if two values are NOT equal — e.g. if username != "Admin"

37
New cards

What does the > operator do in Swift?

Checks if the left value is greater than the right — e.g. if balance > 50

38
New cards

What does the < operator do in Swift?

Checks if the left value is less than the right — e.g. if age < 18

39
New cards

What does the >= operator do in Swift?

Checks if the left value is greater than or equal to the right — e.g. if cardBalance >= 25

40
New cards

What is the "double equals trap" in Swift?

Confusing == (comparison — asking "is it equal?") with = (assignment — setting a value). Always use == inside if conditions.

41
New cards

What is the curly brace rule in if-else statements?

All code that should run as part of the if or else must be "hugged" inside curly braces { } — e.g. if condition { print("yes") } else { print("no") }

42
New cards

What is a function in Swift?

A named, reusable block of code that performs a specific task. You define it once and call it by name whenever you need it.

43
New cards

What keyword do you use to define a function in Swift?

func — e.g. func playMusic() { }

44
New cards

What is the syntax for defining a basic function with no parameters in Swift?

func functionName() { // code to run }

45
New cards

How do you call (run) a function in Swift?

Write the function name followed by parentheses — e.g. playMusic()

46
New cards

What is a parameter in a Swift function?

A placeholder variable defined inside the function's parentheses that allows the function to accept input — e.g. func orderFood(item: String)

47
New cards

What is an argument in a Swift function?

The actual value you pass in when calling the function — e.g. orderFood(item: "Pizza") — "Pizza" is the argument.

48
New cards

What does () do inside a Swift string?

String interpolation — it injects the value of a variable directly into a string. e.g. print("You ordered (item)") prints the actual item value, not the word "item".

49
New cards

Why does order matter when defining and calling functions in Swift?

Swift must read and know what a function is before it can run it — always define the function above the line where you call it.

50
New cards

What is the difference between a function with no parameters and one with parameters?

No parameters: func greet() { } — does the same thing every time. With parameters: func greet(name: String) { } — behaves differently based on the input passed in.

51
New cards

What is a For-In loop in Swift?

A loop that repeats a block of code a set number of times or once for every item in a list. It is the "repeat button" for your code.

52
New cards

What is the syntax of a basic For-In loop in Swift?

for _ in 1…5 { // action } — the underscore means you don't need to use the number, and 1…5 sets the range.

53
New cards

What does the _ mean in a For-In loop?

It means you don't need to use the loop's current number — you just want the action to repeat the given number of times.

54
New cards

What does 1…5 mean in a Swift For-In loop?

A closed range — the loop runs from 1 to 5, inclusive, meaning the action repeats 5 times.

55
New cards

How do you count down in a For-In loop in Swift?

Use (1…10).reversed() to loop from 10 down to 1, or use stride(from: 10, to: 0, by: -1).

56
New cards

What is an Array in Swift?

An ordered list of items of the same type stored in a single variable — e.g. var myItems = ["Laptop", "Mouse", "Keyboard"]

57
New cards

What is the syntax for creating an array in Swift?

var arrayName = ["item1", "item2", "item3"] — items are separated by commas inside square brackets [ ].

58
New cards

How do you loop through every item in an array in Swift?

Use a for-in loop: for item in myArray { print(item) } — the loop runs once for each item in the array.

59
New cards

What does the loop constant represent when looping through an array?

It is a temporary name that holds the current item the loop is processing — e.g. for student in students means student holds one name at a time.

60
New cards

What does .count do on an array in Swift?

Returns the number of items in the array — e.g. animals.count returns 3 if the array has 3 items.

61
New cards

What is the relationship between a For-In loop and an Array?

The array is the "shopping list" (the data), and the for-in loop is the "repeat machine" that processes each item in that list one by one.

62
New cards

What happens when a For-In loop reaches the end of an array?

The loop automatically stops — it does not need to know the number of items in advance, it just stops when there are no more items left.