home-assistant / Iconic

:art: Auto-generated icon font library for iOS, watchOS and tvOS
Apache License 2.0
1.58k stars 86 forks source link

Supports optional edge insets for attributed strings #8

Closed dzenbot closed 8 years ago

dzenbot commented 8 years ago

Closes #3

Adding a way to add a built-in left and right margins to icon when used in attributed strings. This is specially convenient as when trying to combine an icon and label using NSAttributedString, so we avoid to use a hardcoded whitespace in the string. The edge insets may also help for adjusting the icon's baseline, when using either top and bottom insets.

Right margin UIEdgeInsetsMake(0, 0, 0, 15): bolt

Larger margin UIEdgeInsetsMake(0, 0, 0, 30): bolt

This PR also includes a shiny new playground file, to test things quickly (this feature was expedited thanks to the playground). The playground imports the Iconic module using CocoaPods.