Sha256: 3bb14b741dc4a11c21851549858f0ebec3416983efe69acb83bb1240a6a7aff5

Contents?: true

Size: 450 Bytes

Versions: 51

Compression:

Stored size: 450 Bytes

Contents

module MotionPrime
  class ImageElement < BaseElement
    after_render :fetch_image
    def view_class
      "UIImageView"
    end

    def fetch_image
      return unless computed_options[:url]
      raise "You must set default image for `#{name}`" unless computed_options[:default]
      view.setImageWithURL NSURL.URLWithString(computed_options[:url]),
                        placeholderImage: computed_options[:default].uiimage
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
motion-prime-0.5.2 motion-prime/elements/image.rb
motion-prime-0.5.1 motion-prime/elements/image.rb
motion-prime-0.5.0 motion-prime/elements/image.rb
motion-prime-0.4.5 motion-prime/elements/image.rb
motion-prime-0.4.4 motion-prime/elements/image.rb
motion-prime-0.4.3 motion-prime/elements/image.rb
motion-prime-0.4.2 motion-prime/elements/image.rb
motion-prime-0.4.1 motion-prime/elements/image.rb
motion-prime-0.4.0 motion-prime/elements/image.rb
motion-prime-0.3.3 motion-prime/elements/image.rb
motion-prime-0.3.2 motion-prime/elements/image.rb