下面我的代码我希望使用手势移动shapeLayer(图层)。
def paymentEntriesIds = paymentEntryIds(selectedCategory)
def c = Payment.createCriteria()
def result = new ArrayList()
// If there are no payment entries matching category criteria, we return empty list anyway, so there
// is no need querying payments.
if (paymentEntriesIds.size() > 0) {
result = c {
paymentEntries {
inList("id", paymentEntriesIds)
}
if (importEntryId != null) {
eq("importEntry.id", importEntryId)
}
if (query != null) {
ilike("description", query)
}
// Omitted ordering and paging
}
}
result
我使用波纹管触摸功能识别图层,但没有用。
let shapeLayer = CAShapeLayer()
let ellipsePath = UIBezierPath(ovalInRect: CGRectMake(100, 200, width , height))
shapeLayer.path = ellipsePath.CGPath
shapeLayer.fillColor = UIColor.clearColor().CGColor
shapeLayer.strokeColor = UIColor.blueColor().CGColor
shapeLayer.lineWidth = 1
shapeLayer.sublayers?.removeAll()
self.view.layer.addSublayer(shapeLayer)