0
0
iOS Swiftmobile~10 mins

matchedGeometryEffect in iOS Swift - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to apply a matchedGeometryEffect with the given ID.

iOS Swift
Text("Hello")
  .matchedGeometryEffect(id: [1], in: namespace)
Drag options to blanks, or click blank then click option'
A"textID"
B"matchID"
C"viewID"
D"animationID"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of a string literal.
Omitting the quotes around the ID string.
2fill in blank
medium

Complete the code to declare a namespace for matchedGeometryEffect.

iOS Swift
@Namespace private var [1]
Drag options to blanks, or click blank then click option'
Aanimation
Bmatch
Cnamespace
Deffect
Attempts:
3 left
💡 Hint
Common Mistakes
Using a name that conflicts with other variables.
Not declaring the variable as private.
3fill in blank
hard

Fix the error in the matchedGeometryEffect modifier by completing the missing parameter.

iOS Swift
Rectangle()
  .matchedGeometryEffect(id: "box", in: [1])
Drag options to blanks, or click blank then click option'
Anamespace
Bmatch
Ceffect
Danimation
Attempts:
3 left
💡 Hint
Common Mistakes
Passing a string instead of the namespace variable.
Using an undeclared variable.
4fill in blank
hard

Fill both blanks to create a matchedGeometryEffect linking two views with the same ID and namespace.

iOS Swift
Text("Start")
  .matchedGeometryEffect(id: [1], in: [2])

Text("End")
  .matchedGeometryEffect(id: [1], in: [2])
Drag options to blanks, or click blank then click option'
A"sharedID"
B"uniqueID"
Cnamespace
Danimation
Attempts:
3 left
💡 Hint
Common Mistakes
Using different IDs for the two views.
Using different namespace variables.
5fill in blank
hard

Fill all three blanks to create a matchedGeometryEffect with a custom anchor and isSource flag.

iOS Swift
Circle()
  .matchedGeometryEffect(id: [1], in: [2], anchor: [3], isSource: false)
Drag options to blanks, or click blank then click option'
A"circleID"
Bnamespace
C.center
D.topLeading
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid anchor value.
Passing the ID without quotes.
Using an undeclared namespace variable.