ios - Best way for adding the universal custom cell for iPhone and iPad -


i have created 1 custom cell universal application. found 2 ways implementing custom cell both iphone , ipad :

  1. the first way can create programmatically :

    if ([[uidevice currentdevice] userinterfaceidiom] == uiuserinterfaceidiomphone) {  //pragmatically setting bounds iphone components  } else {     //pragmatically setting bounds ipad components   } 

    or second way

  2. creating 2 separate xibs of custom cell iphone , ipad , load accordingly like:

    if ([[uidevice currentdevice] userinterfaceidiom] == uiuserinterfaceidiomphone) {   //load iphone custom cell here  } else {   //load ipad custom cell here  } 

so question , there other way ? or best way ?

you can create cell autolayout (programmatically or in xib). don't know how your's cells differs in ipad , iphone, may able define constrains satisfy claim @ both devices.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -