Sha256: 1ca6a2ae256c76499b6792b6e676847c9943e0a0928cf125b9da0ceb08909aca

Contents?: true

Size: 737 Bytes

Versions: 8

Compression:

Stored size: 737 Bytes

Contents

module ProMotion
  module ScreenElements
    include ProMotion::ViewHelper

    def add(element, attrs = {})
      add_to self.view, element, attrs
    end
    alias :add_element :add
    alias :add_view :add

    def remove(element)
      element.removeFromSuperview
      element = nil
    end
    alias :remove_element :remove
    alias :remove_view :remove

    def add_to(parent_element, element, attrs = {})
      parent_element.addSubview element
      if attrs && attrs.length > 0
        set_attributes(element, attrs)
        set_easy_attributes(parent_element, element, attrs)
      end
      element
    end

    def bounds
      return self.view.bounds
    end

    def frame
      return self.view.frame
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ProMotion-0.7.8 lib/ProMotion/screen_helpers/screen_elements.rb
ProMotion-0.7.6 lib/ProMotion/screen_helpers/screen_elements.rb
ProMotion-0.7.5 lib/ProMotion/screen_helpers/screen_elements.rb
ProMotion-0.7.4 lib/ProMotion/screen_helpers/screen_elements.rb
ProMotion-0.7.3 lib/ProMotion/screen_helpers/screen_elements.rb
ProMotion-0.7.2 lib/ProMotion/screen_helpers/screen_elements.rb
ProMotion-0.7.1 lib/ProMotion/screen_helpers/screen_elements.rb
ProMotion-0.7.0 lib/ProMotion/screen_helpers/screen_elements.rb