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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -