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 :
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
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
Post a Comment