Sha256: 135e913fcfed7a454c6016e2edf86a05602395d7de3da5df41779b01555899f2

Contents?: true

Size: 1.46 KB

Versions: 15

Compression:

Stored size: 1.46 KB

Contents

# @requires MotionKit::NSViewHelpers
module MotionKit
  class NSViewHelpers

    def content_compression_resistance_priority(value, for_orientation: orientation)
      orientation = Constraint.orientation_lookup(orientation)
      target.setContentCompressionResistancePriority(value, forOrientation: axis)
    end

    def compression_priority(value, for_orientation: orientation)
      content_compression_resistance_priority(value, for_orientation: orientation)
    end

    def content_hugging_priority(value, for_orientation: orientation)
      orientation = Constraint.orientation_lookup(orientation)
      target.setContentHuggingPriority(value, forOrientation: axis)
    end

    def hugging_priority(value, for_orientation: orientation)
      content_hugging_priority(value, for_orientation: orientation)
    end

    ##|
    ##|  Aliases for consistency with iOS versions:
    ##|

    def content_compression_resistance_priority(value, for_axis: orientation)
      content_compression_resistance_priority(value, for_orientation: orientation)
    end

    def compression_priority(value, for_axis: orientation)
      content_compression_resistance_priority(value, for_orientation: orientation)
    end

    def content_hugging_priority(value, for_axis: orientation)
      content_hugging_priority(value, for_orientation: orientation)
    end

    def hugging_priority(value, for_axis: orientation)
      content_hugging_priority(value, for_orientation: orientation)
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

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