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:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.