How can I use cached image from StyleKit to customize UIButton/NSButton with states?

How can I use cached image from StyleKit to customize UIButton/NSButton with states?

StyleKit provides methods that return cached NSImage/UIImage (such methods begins with imageOfMyCanvas prefix). If you use a variable in your canvas to control state (or look) of your drawing, this variable becomes a parameter of the imageOf...method.

Please, check out the example project and check the viewWillAppear(_:) (Objective-C: viewWillAppear:) method in EXTabBarsAndButtonsViewController class and Swift setBackgroundImage(_:forState:) or Objective-C setBackgroundImage:forState: method to see how to use image provided by StyleKit to customize UIButton.

Also, check out the "Button" canvas inside "TabBar" and "Button Tab" in "Example.pcvd" document (included in the project).