Sha256: 474a81d1e97a91e5a9c9e95c87f778384f78d41e59f52e7de38832dcd021c711

Contents?: true

Size: 655 Bytes

Versions: 3

Compression:

Stored size: 655 Bytes

Contents

# @provides MotionKit::Layout
# @provides MotionKit::UIViewLayout
# @requires MotionKit::TreeLayout
module MotionKit
  class Layout < TreeLayout

    # platform specific default root view
    def default_root
      # child Layout classes will return *their* UIView subclass from self.targets
      view_class = self.class.targets || MotionKit.default_view_class
      view_class.alloc.initWithFrame(UIScreen.mainScreen.applicationFrame)
    end

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

    def remove_child(subview)
      subview.removeFromSuperview
    end

  end

  class UIViewLayout < Layout
    targets UIView
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
motion-kit-0.11.2 lib/motion-kit-ios/layouts/uiview_layout.rb
motion-kit-0.11.1 lib/motion-kit-ios/layouts/uiview_layout.rb
motion-kit-0.11.0 lib/motion-kit-ios/layouts/uiview_layout.rb