gpt4 book ai didi

ios - 在 Swift 3.0 中检测两个对象之间的碰撞?

转载 作者:行者123 更新时间:2023-11-28 09:43:09 27 4
gpt4 key购买 nike

我在屏幕上添加了 2 个 UIView,我想检测它们是否发生碰撞。如果是这样,那么我需要在屏幕上显示警报。

最佳答案

关于

if (CGRectIntersectsRect(secondView.frame, sender.frame)) {
// Do something
}

关于ios - 在 Swift 3.0 中检测两个对象之间的碰撞?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42316446/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com