Sha256: afa9751fd7b358ddbe2c7ee5e78ff2a72244ff60fe560a7ee5b2869995adeaa0

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 Bytes

Contents

# @provides MotionKit::CALayerHelpers
# @requires MotionKit::TreeLayout
module MotionKit
  class CALayerHelpers < TreeLayout
    targets CALayer

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

    def add_child(subview, options={})
      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

1 entries across 1 versions & 1 rubygems

Version Path
motion-kit-1.1.1 lib/motion-kit-cocoa/helpers/calayer_helpers.rb