lib/ios/sugarcube-factories/uilabel.rb in sugarcube-3.2.0 vs lib/ios/sugarcube-factories/uilabel.rb in sugarcube-3.3.0
- old
+ new
@@ -1,11 +1,12 @@
class UILabel
- # UILabel.new('test')
- # UILabel.new('test', another_label.font)
- # UILabel.new('test', 'Helvetica')
- # UILabel.new('test', 'Helvetica', 20)
- def self.new(text=nil, font=nil, size=nil)
+ # @example
+ # UILabel.label('test')
+ # UILabel.label('test', another_label.font)
+ # UILabel.label('test', 'Helvetica')
+ # UILabel.label('test', 'Helvetica', 20)
+ def self.label(text=nil, font=nil, size=nil)
return super() if text.nil?
font = font.uifont(size) if font.respond_to?(:uifont)
label = self.alloc.initWithFrame([[0, 0], [0, 0]])
if text.is_a?(NSAttributedString)