我正在尝试触摸滑动拼图块的各个部分,以便它们可以在屏幕上移动
我想将用户首次点击屏幕分配到myTouch
,然后执行一些操作。
在旧代码中,[[touches allObjects] objectAtIndex:0]
是我需要的,但不知道如何使这行代码在Swift中工作。
var tapCen = CGPoint(); var left = CGPoint(); var right = CGPoint(); var top = CGPoint(); var bottom = CGPoint(); override func touchesEnded(touches: Set<UITouch>, withEvent event: UIEvent?) { let allTouches = event?.allTouches() let myTouch = allTouches?.first if myTouch!.view != self.view { tapCen = myTouch!.view!.center } }
答案 0 :(得分:1)
你可以试试这个
use WindowsAzure\Table\Models\Filters\QueryStringFilter;
use WindowsAzure\Table\Models\QueryEntitiesOptions;
$options = new QueryEntitiesOptions();
$filter = new QueryStringFilter("(RowKey eq 'E1591D1')");
$options->setFilter($filter);
$options->setTop(5);
编辑SWift 3.0
let allTouches = event.allTouches()
let myTouch = allTouches?.first