Sha256: a52aa3bd46ad4a0b9b2bf785bd5c5e3eb1f996489d642e6b7feddd36cf874764
Contents?: true
Size: 705 Bytes
Versions: 14
Compression:
Stored size: 705 Bytes
Contents
# @requires MotionKit::NSViewLayout module MotionKit class NSViewLayout def constraints(view=nil, &block) view ||= target if view.is_a?(Symbol) view = self.get(view) end view.setTranslatesAutoresizingMaskIntoConstraints(false) deferred do constraints_target = ConstraintsTarget.new(view) context(constraints_target, &block) constraints_target.apply_all_constraints(self, view) end end end class Layout def constraints(view=nil, &block) if @context apply(:constraints, view, &block) else context(self.view) do constraints(view, &block) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems