Sha256: b71522841d4df7e3771a8970c098cc3e11842bf1c935ec6d21df389f2d97e89f

Contents?: true

Size: 657 Bytes

Versions: 18

Compression:

Stored size: 657 Bytes

Contents

# @provides MotionKit::Layout
# @provides MotionKit::UIViewHelpers
# @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 UIViewHelpers < Layout
    targets UIView
  end

end

Version data entries

18 entries across 14 versions & 1 rubygems

Version Path
motion-kit-1.1.0 lib/motion-kit-tvos/helpers/uiview_helpers.rb
motion-kit-1.0.3 lib/motion-kit-tvos/helpers/uiview_helpers.rb
motion-kit-1.0.3 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-1.0.2 lib/motion-kit-tvos/helpers/uiview_helpers.rb
motion-kit-1.0.2 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-1.0.1 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-1.0.1 lib/motion-kit-tvos/helpers/uiview_helpers.rb
motion-kit-1.0.0 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-1.0.0 lib/motion-kit-tvos/helpers/uiview_helpers.rb
motion-kit-0.18.0 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-0.17.0 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-0.16.0 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-0.15.0 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-0.14.2 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-0.14.1 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-0.14.0 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-0.13.0 lib/motion-kit-ios/helpers/uiview_helpers.rb
motion-kit-0.12.0 lib/motion-kit-ios/layouts/uiview_helpers.rb