How to tap on element attribute type as "UIASwitch"

I have a ios screen which is having multiple UIASwitch elements. I am using Page object framework.

This is my code:

element :alarm, :UIASwitch, :name => 'morning’

def tap_alarm
alarm_element.click
end

Nothing happens.

Thanks in advance!

sw = tags(:UIASwitch)
sw.each do |item|
    if (item.name == 'morning') 
         item.click
    end
end

If you search for all elements you can even do:

find('morning').click