防止点击识别器中的内存泄漏

时间:2017-08-03 11:18:45

标签: swift swift3 memory-leaks xcode8

//我在这段代码上出现内存泄漏。有任何想法吗? (我认为它连接到tapRecognizer)

func paletteTapped( _ tapRecognizer : UITapGestureRecognizer )
{
    if tapRecognizer.state == .ended {
        let touch = tapRecognizer.location( in: self )
        if let color = colorForTouch(touch) {
            self.delegate?.selectPaletteColor(color)
        }
        fadeOut()
    }
}

0 个答案:

没有答案