Is there a feasible drag gesture solution for a boggle type word grid?

Viewed 54

So I just would like to know at a high level if there is a non-hack solution for this problem.

Word Grid on phone screen: Word Grid on phone screen

I would like for the user to be able to start on a given letter, then drag to other letters to form words. For a developer perspective I care about:

  • Is there a way for for each children to know about its neighbors?
  • Is the solution here to map every neighboring letter to a x,y coordinate or is there a better solution?

I feel like the answer here involves a geometry reader?

Happy to include more details as needed.

1 Answers

You may want to use PreferenceKey. You can report the size of the children to those parents by using it.

I recommend you read SwiftUI Lab's article.

Related