Sha256: f94e83e4d526fe9d766dca40394f959cd8a3f194f5d8ed2431125e570b6ec08c

Contents?: true

Size: 1.21 KB

Versions: 21

Compression:

Stored size: 1.21 KB

Contents

# @provides MotionKit::UIButtonLayout
# @requires MotionKit::UIViewLayout
module MotionKit
  class UIButtonLayout < UIViewLayout
    targets UIButton

    def title(value)
      title(value, state: UIControlStateNormal)
    end

    def title(value, state: state)
      if value.is_a?(NSAttributedString)
        target.setAttributedTitle(value, forState: state)
      else
        target.setTitle(value, forState: state)
      end
    end

    def title_color(value)
      title_color(value, state: UIControlStateNormal)
    end

    def title_color(value, state: state)
      target.setTitleColor(value, forState: state)
    end

    def title_shadow_color(value)
      title_shadow_color(value, state: UIControlStateNormal)
    end

    def title_shadow_color(value, state: state)
      target.setTitleShadowColor(value, forState: state)
    end

    def background_image(value)
      background_image(value, state: UIControlStateNormal)
    end

    def background_image(value, state: state)
      target.setBackgroundImage(value, forState: state)
    end

    def image(value)
      image(value, state: UIControlStateNormal)
    end

    def image(value, state: state)
      target.setImage(value, forState: state)
    end

  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
motion-kit-0.11.2 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.11.1 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.11.0 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.11 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.10 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.9 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.8 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.7 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.6 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.5 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.4 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.3 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.2 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.1 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.10.0 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.9.6 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.9.4 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.9.3 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.9.2 lib/motion-kit-ios/layouts/uibutton_layout.rb
motion-kit-0.9.1 lib/motion-kit-ios/layouts/uibutton_layout.rb