Pull control Bar up in iOS?

I want to toggle wi-fi in iOS. Apparently, the only way to do it is to pull up the control bar and then tap on Airplane mode. However, I am not able to perform a swipe up to pull the control bar. Any help regarding the same?

Using ruby:

swipe(:start_x => 0.5, :start_y => 0.999, :end_x => 0.5, :end_y => 0.2, :duration => 1000)

Sounds good. But the swipe method in Java, it only takes integers. How do I make things work there?

Well I guess you need to get the Width and Height of screen and convert into the pixels you need for that swipe

I am able to get the height and width of screen, but how do I convert them to pixels?
Besides, when I pass the captured height and width of screen as params to the ‘driver.swipe()’ function, it just swipes in the application instead of pulling the control bar up.

I am using iPHONE 4S. The height and width captured are : 320, 480 respectively.
So I call the function :> “driver.swipe(320, 480, 320, 200, 2000)”
This just performs a swipe on the application and does not pull the control bar up!