Bird
0
0

What will be the visible effect of this code snippet?

medium📝 Predict Output Q4 of 15
iOS Swift - Animations
What will be the visible effect of this code snippet?
UIView.animate(withDuration: 1.0, delay: 0, options: .curveEaseOut, animations: {
  view.alpha = 0
}, completion: nil)
AThe view fades out quickly at first, then slowly at the end.
BThe view fades out at a constant speed.
CThe view fades out slowly at first, then faster at the end.
DThe view does not fade out because of missing completion.
Step-by-Step Solution
Solution:
  1. Step 1: Understand curveEaseOut behavior

    curveEaseOut means animation starts fast and slows down at the end.
  2. Step 2: Apply to alpha fade out

    The view's alpha goes from 1 to 0, fading out quickly at first, then slowing near the end.
  3. Final Answer:

    The view fades out quickly at first, then slowly at the end. -> Option A
  4. Quick Check:

    Ease-out = fast start, slow end [OK]
Quick Trick: Ease-out means fast start, slow finish [OK]
Common Mistakes:
  • Confusing ease-out with ease-in
  • Thinking completion affects animation visibility
  • Assuming constant speed fade

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More iOS Swift Quizzes