2

I have my ios application I want to check how 3D touch available means (iPhone 6s or iPhone6s plus)?

so how can I check it?

Cœur
  • 37,241
  • 25
  • 195
  • 267
bhavik
  • 1,673
  • 2
  • 14
  • 20

1 Answers1

5

You should try this.

//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];
}