Open peepo3663 opened 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.
UINavigationBar.appearance()
Hi Wasupol, Thanks for pointing it out.
In your code,
a lot of singletons could be reuse
You could reuse
UINavigationBar.appearance()
as local variable so It will not be call many time.