ananthbh / SurveyList

0 stars 0 forks source link

You would have more reusable codes #7

Open peepo3663 opened 6 years ago

peepo3663 commented 6 years ago

In your code,

a lot of singletons could be reuse

UINavigationBar.appearance().barTintColor = backgroundColor
UINavigationBar.appearance().tintColor = foregroundColor
UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor: foregroundColor]
UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
UINavigationBar.appearance().backgroundColor = backgroundColor.withAlphaComponent(0.5)
UINavigationBar.appearance().isTranslucent = true

You could reuse UINavigationBar.appearance() as local variable so It will not be call many time.

ananthbh commented 6 years ago

Hi Wasupol, Thanks for pointing it out.