Sha256: b3e456b41a46301cb4bfb263b53dfe374bb321ad7a4b60f4c1508937fecc374b

Contents?: true

Size: 617 Bytes

Versions: 6

Compression:

Stored size: 617 Bytes

Contents


class UIView

  def <<(view)
    self.addSubview view
  end

  # i like this idea, but view[0] = view doesn't *look* like an insertion,
  # it lookes like a replacement... it should be written as
  #     view[0] += sub_view
  # or
  #     view[0] << sub_view
  # def []=(index, view)
  #   self.insertSubview(view, atIndex:index)
  # end

  def to_s
    "{#{self.class.name} @ x: #{self.frame.origin.x} y:#{self.frame.origin.y}, "\
                        "#{self.frame.size.width}×#{self.frame.size.height}}"\
                        "#{self.superview ? ' child of ' + self.superview.class.name : ''}"
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sugarcube-0.1.6 lib/sugarcube/uiview.rb
sugarcube-0.1.5 lib/sugarcube/uiview.rb
sugarcube-0.1.4 lib/sugarcube/uiview.rb
sugarcube-0.1.3 lib/sugarcube/uiview.rb
sugarcube-0.1.2 lib/sugarcube/uiview.rb
sugarcube-0.1.1 lib/sugarcube/uiview.rb