셀의 LongPressGesture와 ScrollView의 Scroll Gesture가 안되는 문제를 파악했습니다.
try 1) 원인을 잘 몰랐을 때 StackOverFlow에 있는 이유는 모르겠지만 longPressGesture modifier를 추가하기 전에 .onTapGesture를 추가하면 해결된다.라는 답변을 따라 수정해서 제스처 중첩 문제를 해결했었지만, 애니메이션이 적용되지 않는 문제가 발생했습니다.
try 2) 배포 전, 미봉책으로 Rectangle 셀들의 간격(padding)을 길게 주어서 스크롤할 수 있는 영역을 넓혔습니다.
try 3) ScrollView의 안에 있는 Rectangle 셀에서 바깥의 ScrollView에 접근하는 방식이나 LongPressGesture가 실행되거나 실패된 후 해당 제스처가 인식된걸 해제하는 방법을 찾아서 해결하려고 했지만, 방법을 찾지 못했습니다.
try 4) ⭐️Rectangle 셀 위에서 Scroll이 가능해야한다.⭐️로 문제 정의를 한 뒤, 여러 시도를 해보니 LongPressGesture의 우선순위가 높아서 생긴 문제임을 발견했습니다. simultaneousGesture나 highPriorityGesture를 사용해서 Scroll과 LongPressGesture의 우선순위를 같게 하거나 Scroll 제스처의 우선순위를 높이는 방법으로 시도했으나 실패했습니다.
try 5) 우선순위를 다르게 주는 방식을 고려하다가, longPressGesture에 딜레이를 걸어주는 방식을 생각했습니다. 그 결과 원하는 의도대로 잘 동작하게 되었습니다 :D
Key Change
ScrollView에 우선순위를 주기 위해 SwiftUIDelayedGesture라는 라이브러리를 사용해서 LongPressGesture에 딜레이를 걸어주었습니다.
To Reviewers
ScrollView + LongPressGesutre + Animation 3박자가 갖춰진 사례가 없어서 해결하는 데에 애먹었는데, 문제를 정확하게 정의하고나니 생각보다 간단하게 해결하게 되었습니다!
Motivation
이유는 모르겠지만 longPressGesture modifier를 추가하기 전에 .onTapGesture를 추가하면 해결된다.
라는 답변을 따라 수정해서 제스처 중첩 문제를 해결했었지만, 애니메이션이 적용되지 않는 문제가 발생했습니다.simultaneousGesture
나highPriorityGesture
를 사용해서 Scroll과 LongPressGesture의 우선순위를 같게 하거나 Scroll 제스처의 우선순위를 높이는 방법으로 시도했으나 실패했습니다.Key Change
SwiftUIDelayedGesture
라는 라이브러리를 사용해서 LongPressGesture에 딜레이를 걸어주었습니다.To Reviewers
ScrollView + LongPressGesutre + Animation 3박자가 갖춰진 사례가 없어서 해결하는 데에 애먹었는데, 문제를 정확하게 정의하고나니 생각보다 간단하게 해결하게 되었습니다!
Close #211