我有一个scrollView,里面有子视图。我想要在子视图之外进行任何触摸,以使scrollview像在任何其他情况下一样滚动。但是当触摸位于子视图内时,我不想要滚动来注册(所以我可以使用该触摸来拖动)。 class ViewController: UIViewController {
@IBOutlet weak var scrollView: UIScrollView!
我试图检测用户是否正在触摸SKScene屏幕的左侧或右侧。 我把下面的代码放在一起,但它只输出“正确”,而不管在哪里被触摸。 override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in touches {
let location = touch.loc
在Laravel框架中,我有2个模型。首先是问题的模型: class Question extends Model
{
protected $table = 'questions';
protected $fillable = [...];
public function answers()
{
return $this->hasMany('A