Sprężyny i niestandardowe krzywe czasu
Dostosuj ruch za pomocą sprężyn i funkcji easing
Sprężyny i niestandardowe krzywe czasu to bezpłatna lekcja SwiftUI Academy na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej SwiftUI Academy, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs SwiftUI Academy zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
The Feel of Motion
How an animation accelerates and settles shapes its personality. The timing curve decides whether motion feels snappy, smooth, or bouncy.
Linear Is Constant
A linear curve moves at one steady speed start to finish. It can feel mechanical, so it suits progress bars more than UI.
.animation(.linear, value: x)Ease In and Out
The easeInOut curve starts slow, speeds up, then slows to a gentle stop, the most natural choice for most UI.
.animation(.easeInOut, value: x)Ease In vs Ease Out
Use easeIn to start gently and easeOut to stop gently, picking which end of the motion feels softer.
Meet Springs
A spring animation models real physics, overshooting slightly and settling, which feels lively and responsive.
.animation(.spring, value: x)Tune the Bounce
The bounce parameter sets how springy the motion is. Zero is smooth; higher values add a playful overshoot.
.spring(duration: 0.5, bounce: 0.3)Response and Damping
Springs can also be tuned with response for speed and damping for how quickly the bounce dies out.
.interpolatingSpring(
stiffness: 170, damping: 15)Custom Bezier Curves
For full control, timingCurve lets you define a custom bezier with your own control points and duration.
.timingCurve(0.2, 0.8, 0.2, 1,
duration: 0.5)Add a Delay
Chain .delay onto any animation to wait before it begins, perfect for staggering several elements.
.animation(.spring.delay(0.1), value: x)Repeat the Motion
Use repeatForever or repeatCount to loop an animation, ideal for pulsing dots and loading hints.
.easeInOut.repeatForever(
autoreverses: true)Speed It Up or Down
The .speed modifier scales an animation faster or slower without rewriting its curve or duration.
.animation(.default.speed(2), value: x)Quick Check
Which curve gives the most natural everyday UI motion?
Recap: Curves and Springs
You explored timing curves from linear to easeInOut, lively springs with bounce, custom beziers, delays, and repeats. Now your motion has personality. 🚀
Często zadawane pytania
Czy lekcja „Sprężyny i niestandardowe krzywe czasu” jest bezpłatna?
Tak — pełny tekst „Sprężyny i niestandardowe krzywe czasu” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu SwiftUI Academy, przejdź na CoddyKit PRO. Kurs SwiftUI Academy zawiera 4 lekcji w sumie.
Co nauczysz się w „Sprężyny i niestandardowe krzywe czasu”?
Dostosuj ruch za pomocą sprężyn i funkcji easing Ćwiczysz SwiftUI Academy z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć SwiftUI Academy?
Nie wymagamy żadnego doświadczenia. SwiftUI Academy w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.
Ile czasu zajmuje lekcja „Sprężyny i niestandardowe krzywe czasu”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji SwiftUI Academy?
Tak. Każda lekcja SwiftUI Academy zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Animacje niejawne
- Jawne animacje z withAnimation
- Przejścia podczas wstawiania i usuwania
- Sprężyny i niestandardowe krzywe czasu