我正在使用搖晃手勢在我的應用程序中創建新帖子。如何在啓動屏幕期間停止搖動手勢?如何在iOS中停止搖動手勢?
override func motionEnded(_ motion: UIEventSubtype,
with event: UIEvent?) {
if motion == .motionShake {
if self.revealtype == "opened" {
self.revealViewController().revealToggle(self)
}
datearray.removeAll()
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd-MM-yyyy"
let monthdate = dateFormatter.string(from: NSDate() as Date)
datearray.append(monthdate)
selectnsdate = Date()
print("success")
let ivc = self.storyboard!.instantiateViewController(withIdentifier: "selectpost") as? SelectPost
ivc?.shake = true
self.navigationController!.pushViewController(ivc!, animated: true)
}
}