Because of a generics you will be forced to use the same generic parameters as view type you are applyying style to. If you want to apply style with another generic parameter - you can user wrapped function from Style class
Using wrap function
myButton.apply(borderedViewStyle.wrapped())
Installation
CocoaPods
You can use CocoaPods dependency manager to install NerdzStyle.
In your Podfile spicify:
NerdzStyle
NerdzStyle library allow to easily create and apply CSS-like styles to view elements.
Example
You will need to create a style to be able to use it later on. There are two options how you can do that.
Style creation from aim class
Manual style creation
Also you can inherit from another style to create a custom hierarchy
Style inheriting from aim class
Manual style inheritence
To apply
Style
into some view instance you can use one of two possible waysApplying from view
Applying from style
Also you can apply more than one style at once. The style priority will be increasing from left to right
Applying several styles to view
You can also apply same style to several views
Applying style to several views
Because of a generics you will be forced to use the same generic parameters as view type you are applyying style to. If you want to apply style with another generic parameter - you can user
wrapped
function fromStyle
classUsing wrap function
Installation
CocoaPods
You can use CocoaPods dependency manager to install
NerdzStyle
. In yourPodfile
spicify:Swift Package Manager
To add NerdzStyle to a Swift Package Manager based project, add:
License
This code is distributed under the MIT license. See the
LICENSE
file for more info.