objective c - Naming conventions for Universal Applications -
i'm writing universal ios application (ipad , iphone) , find myself massively long names classes can't shared between 2 apps:
familyviewcontroller_iphone.h/m familyviewcontrollera_ipad.h/m detailviewcontrollerb_iphone.h/m detailviewcontrollerb_ipad.h/m
and likewise, classes inside of these guys have complete name (device included) interface builder can use them.
i considered acontrollera.h , bcontrollera.h a=iphone , b=ipad not excited option either.
what standing convention classes in ios universal application - or (hopefully) missing obviates necessity?
i think you're heading down bad path separating functionality this. while ipad apps can have different ui structures , design iphone apps, it's best if can try remain abstract possible.
i avoid using platform names in view controllers. i'd have:
familyviewcontroller.h familyviewcontroller.m familyviewcontroller.xib (which used ipad ui) familyviewcontroller~iphone.xib
you're going have incredibly similar functionality both iphone , ipad, or if not same, you'll still have lot of overlap.
i never make view controllers act table controllers. keep functionality in separate objects. way, if iphone app has 2 or 3 tables on different screens, ipad shows 3 of tables on same screen can instantiate each of table controllers , of code reusable.
Comments
Post a Comment