강의

멘토링

커뮤니티

Inflearn Community Q&A

jomyounghoon5154's profile image
jomyounghoon5154

asked

SwiftUI - iOS14 Perfect Guide

2 Grid View

Grid View 강의에서 animation 질문

Written on

·

369

0

 ScrollView {
                LazyVGrid(columns: selectedGridType.columns) {
                    ForEach(items) { item in
                        Image(item.imageName)
                            .resizable()
                            .aspectRatio(contentMode: .fit)
                    }
                }
                .animation(.default) // 레이아웃 변경시 부드럽게 변경
            }

 

animation(.default)

이 메서드가 deprecated돼서 animation(.default, value: ...) 로 변경이 필요하다고 합니다.

혹시 어떻게 해야 비슷한 효과가 나올까요?

iosswiftui

Answer 1

0

enilv0529님의 프로필 이미지
enilv0529
Instructor

안녕하세요

 

.animation(.default, value: UUID())

이렇게 하시면 전처럼 자연스럽게 애니메이션 나올거예요

jomyounghoon5154's profile image
jomyounghoon5154

asked

Ask a question