lib/ios/sugarcube-factories/uialertview.rb in sugarcube-2.2.0 vs lib/ios/sugarcube-factories/uialertview.rb in sugarcube-2.3.0
- old
+ new
@@ -63,21 +63,21 @@
raise "If you only have one button, use a :success handler, not :cancel (and definitely not BOTH)"
end
# uses localized buttons in the actual alert
if buttons.is_a?(NSDictionary)
- button_titles = buttons.keys
+ button_keys = buttons.keys
if buttons.key?(:cancel)
args << (buttons[:cancel] && NSBundle.mainBundle.localizedStringForKey(buttons[:cancel], value: nil, table: nil))
else
args << nil
end
args.concat(buttons.select { |k, m| k != :cancel }.map { |k, m| m && NSBundle.mainBundle.localizedStringForKey(m, value: nil, table: nil) })
else
- button_titles = buttons
+ button_keys = buttons
args.concat(buttons.map { |m| m && NSBundle.mainBundle.localizedStringForKey(m, value: nil, table: nil) })
end
- delegate.buttons = button_titles
+ delegate.buttons = button_keys
args << nil # otherButtonTitles:..., nil
alert = self.alloc
alert.send("initWithTitle:message:delegate:cancelButtonTitle:otherButtonTitles:", *args)
if options.key?(:style)