Search
🚨

withAnimation 동작 오류 트러블 슈팅

부제
카테고리
SwiftUI
세부 카테고리
애니메이션
Combine 카테고리
최종편집일
2022/07/16 15:58
작성중
관련된 포스팅
생성 일시
2022/07/16 15:58
태그
이전코드
withAnimation(.spring(response: 0.3, dampingFraction: 0.4, blendDuration: 0.5)) { emailIconBounce.toggle() } withAnimation(.spring(response: 0.3, dampingFraction: 0.4, blendDuration: 0.5).delay(0.15)) { emailIconBounce.toggle() }
Swift
복사
변경 코드
withAnimation(.spring(response: 0.3, dampingFraction: 0.4, blendDuration: 0.5)) { emailIconBounce.toggle() print("DEBUG: \(emailIconBounce)") } DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) { withAnimation(.spring(response: 0.3, dampingFraction: 0.4, blendDuration: 0.5)) { emailIconBounce.toggle() } }
Swift
복사
왜인지 모르겠지만 .delay 메서드가 들어 먹질 않았다.
추가
Rotating the colors that make up the glow is a small and distinct animation that can delight your users, but prove to be computationally expensive. Hence, it's best to make sure that our color rotating animation does not last longer than 10 seconds.
애니메이션은 컴퓨터적으로 자원을 많이 소모함
10초이상의 컬러 애니메이션은 좋지 않다