我有我的 ios 应用程序,我想检查 3D 触摸可用意味着什么(iPhone 6s 或 iPhone6s plus)?
那么我该如何检查呢?
最佳答案
你应该试试这个。
//check if the device supports 3DTouch
if(self.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable){
[self registerForPreviewingWithDelegate:self sourceView:self.view];
}else{
[[[UIAlertView alloc] initWithTitle:@"Error" message:@"3DTouch not available" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show];
}
关于ios - 如何以编程方式检查 iPhone 中可用的 3D Touch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36369058/