My question is a simple one. In android, we can separate xml stylesheet from layout so that it can be reuse everywhere and edited easily for UI design change.
Is it also possible in iOS xcode? if can how (prefer if not from controller)? need libraries? what are good libraries for that?
Thank you for your answer.
You can use Classy to define a styles for your UI in a more CSS like fashion. It's used and maintained byt the people at Wire
You should also look into UIAppearance. It's a design proxy available for most UI elements where you only set the styling once.
you can use UICategory class for UIView for that purpose. create different methods for set
borders
,border colors
, passbazier-paths
,corner
radius
and so many . this is just few of them. category is of UIView so you can use onbuttons
,lables
,textview
,textedits
etc;UIView+category.h
UIView+category.m
Use it
You could create your own styles using enums. By placing enums inside the Styles enum you get a nice grouping:
Then you can use it like this:
You can also then make extensions for the styles you have setup:
And then use the extensions like this: