objective c - iOS - Adding gradient as background to all view controllers -


i set background view controllers gradient. currently, running in viewdidload():

cagradientlayer *gradient = [cagradientlayer layer]; gradient.frame = self.view.bounds; gradient.colors = [nsarray arraywithobjects:(id)[uicolorfromrgb(0x10425e) cgcolor], (id)    [uicolorfromrgb(0x487f9d) cgcolor], nil]; [self.view.layer insertsublayer:gradient atindex:0]; 

how can view controllers without having put in every view controller's viewdidload()?

make uiviewcontroller subclass code, use base class view controllers.


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -