Sha256: 30abc6f88f09aa07ceb46d8ff9650a188bcae3762a8d892c781ca4bcb405437a

Contents?: true

Size: 490 Bytes

Versions: 5

Compression:

Stored size: 490 Bytes

Contents

# @provides MotionKit::CALayerLayout
# @requires MotionKit::ViewLayout
module MotionKit
  class CALayerLayout < ViewLayout
    targets CALayer

    # platform specific default root view
    def default_root
      self.class.targets.layer
    end

    def add_child(subview)
      target.addSublayer(subview)
    end

    def remove_child(subview)
      subview.removeFromSuperlayer
    end

    # a more appropriate name for the root layer
    def layer
      self.view
    end

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
motion-kit-0.9.4 lib/motion-kit-cocoa/layouts/calayer_layout.rb
motion-kit-0.9.3 lib/motion-kit-cocoa/layouts/calayer_layout.rb
motion-kit-0.9.2 lib/motion-kit-cocoa/layouts/calayer_layout.rb
motion-kit-0.9.1 lib/motion-kit-cocoa/layouts/calayer_layout.rb
motion-kit-0.9.0 lib/motion-kit-cocoa/layouts/calayer_layout.rb