Checking if device is iPad
You can use
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
In Swift you can use:
if UIDevice.current.userInterfaceIdiom == .pad { //do stuff}
you must cheack the condition wheather device is iphone/ipad
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {//do ur ipad logic}else{//do ur iphone logic}