質問

I was wondering if anyone has had experience with dragging and dropping labels into a view and detecting if they collide or overlap. I was wondering how this can be done and also if they do collide/overlap that one of them is moved so its not overlapping.

役に立ちましたか?

解決

UIKit Dynamics is the way to go. Especially UICollisionBehavior. You can use gesture recognizers for dragging views. I created a demo project that does exactly what you are asking about.

It's available here:

https://github.com/r3econ/Collision-Behavior-Demo

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top