lib/motion-kit/helpers/base_layout.rb in motion-kit-0.13.0 vs lib/motion-kit/helpers/base_layout.rb in motion-kit-0.14.0
- old
+ new
@@ -274,10 +274,11 @@
def apply_with_target(method_name, *args, &block)
objc_method_name, objc_method_args = objc_version(method_name, args)
ruby_method_name, ruby_method_args = ruby_version(method_name, args)
+ objc_setter = objc_method_name && MotionKit.setter(objc_method_name)
setter = MotionKit.setter(ruby_method_name)
assign = "#{ruby_method_name}="
# The order is important here.
# - unchanged method name if no args are passed (e.g. `layer`)
@@ -288,9 +289,11 @@
# - lastly, try again after converting to camelCase
if objc_method_name && target.respond_to?(objc_method_name)
target.send(objc_method_name, *objc_method_args, &block)
elsif args.empty? && target.respond_to?(ruby_method_name)
target.send(ruby_method_name, *ruby_method_args, &block)
+ elsif objc_setter && target.respond_to?(objc_setter)
+ target.send(objc_setter, *objc_method_args, &block)
elsif target.respond_to?(setter)
target.send(setter, *args, &block)
elsif target.respond_to?(assign)
target.send(assign, *args, &block)
elsif target.respond_to?(ruby_method_name)