「SwiftUI」常用的手势操作-Gesture

Posted by Jiaolong on 2022/04/07

Basic

轻触

.onTapGesture{
 		print("点击")
}

.onTapGesture(count: 2) {	//设置点击次数
		print("点击")
}

长按

.onLongPressGesture {
		print("长按")
}

.onLongPressGesture(minimumDuration: 1) {    //设置最短长按时间	默认为0.5
	print("长按")
}