0Pricing
SwiftUI Academy · درس

الرسوم المتحركة الضمنية

حرّك تغييرات الحالة باستخدام معدّل animation

الرسوم المتحركة الضمنية درس مجاني في SwiftUI Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في SwiftUI Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة SwiftUI Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

Motion Makes It Feel Alive

A change that snaps into place feels jarring. With animation, SwiftUI smoothly tweens between the old and new states for you. ✨

What Implicit Means

An implicit animation watches a value and animates any view change caused by it, without you describing each frame.

The .animation Modifier

You attach .animation to a view and tie it to a value. When that value changes, SwiftUI animates the affected properties.

Circle()
    .scaleEffect(big ? 2 : 1)
    .animation(.default, value: big)

Always Pass a Value

Modern .animation(_:value:) needs the value to observe. SwiftUI only animates when that exact value changes, keeping motion predictable.

What Gets Animated

SwiftUI animates the animatable properties between states: position, size, opacity, rotation, and color all tween smoothly.

Pick a Curve

The first argument is the animation curve. Common choices are .default, .easeInOut, .linear, and .spring for different feels.

.animation(.easeInOut, value: isOn)

Control the Duration

Add a duration to set how long the motion lasts. A short 0.2s feels snappy; a longer 1s feels relaxed.

.animation(.easeInOut(duration: 0.4), value: isOn)

Animate Opacity

Fading is a classic implicit animation. Change opacity with a bound value and SwiftUI cross-fades the view in or out.

Text("Hi")
    .opacity(show ? 1 : 0)
    .animation(.easeIn, value: show)

Animate Rotation

Tie rotationEffect to a value and the view spins smoothly when it flips, perfect for chevrons and loading marks.

.rotationEffect(.degrees(open ? 90 : 0))
.animation(.default, value: open)

Scope It to One Value

Because you name the value, only changes to that value animate. Other view updates stay instant and unaffected.

Turn Animation Off

Pass nil as the animation to disable motion for that value. Handy when a change should jump instantly instead.

.animation(nil, value: count)

Quick Check

How does an implicit animation know when to run?

Recap: Implicit Animations

You learned that .animation(_:value:) smoothly tweens view changes tied to a value. Pick a curve, set duration, and SwiftUI handles the rest. 🎉

الأسئلة الشائعة

هل درس «الرسوم المتحركة الضمنية» مجاني؟

نعم — نص درس «الرسوم المتحركة الضمنية» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة SwiftUI Academy، انتقل إلى CoddyKit PRO. تتضمن دورة SwiftUI Academy 4 دروس في المجموع.

ماذا ستتعلم في «الرسوم المتحركة الضمنية»؟

حرّك تغييرات الحالة باستخدام معدّل animation تتمرن على SwiftUI Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ SwiftUI Academy؟

لا تُشترط خبرة سابقة. SwiftUI Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «الرسوم المتحركة الضمنية»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس SwiftUI Academy هذا؟

نعم. كل درس في SwiftUI Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. الرسوم المتحركة الضمنية
  2. الرسوم المتحركة الصريحة باستخدام withAnimation
  3. انتقالات الإدراج والإزالة
  4. منحنيات التوقيت الزنبركية والمخصصة
← العودة إلى SwiftUI Academy