Sha256: 4c7f6b2478ddd796899c41a400cf5b8ac462dcfb516e7b38ee665b8e19a32dea
Contents?: true
Size: 693 Bytes
Versions: 97
Compression:
Stored size: 693 Bytes
Contents
class Symbol def awesome_icon(options={}) raise "the MotionAwesome gem is required to use sugarcube-awesome" unless defined? MotionAwesome text = MotionAwesome.hex_for_icon( MotionAwesome.xform_icon(self) ) if options.key?(:size) font_size = options[:size] font_size = font_size.uifontsize if font_size.respond_to?(:uifontsize) else font_size = UIFont.systemFontSize end awesome_attrs = {NSFontAttributeName => MotionAwesome.font(font_size)} if options.key?(:color) awesome_attrs[NSForegroundColorAttributeName] = options[:color].uicolor end NSAttributedString.alloc.initWithString(text, attributes: awesome_attrs ) end end
Version data entries
97 entries across 97 versions & 1 rubygems