Question: I am studying about coding and I got a question to control airplane mode in iphone programmatically 

For android phone, we can use usb connection and adb to send unix command to control airplane mode.

Is there any possibility to control airplane mode by unix command and lighting cable connection?

I was checking 
[ios: turn on/off airplane mode from code for iPhone / iPad](https://stackoverflow.com/questions/7075797/ios-turn-on-off-airplane-mode-from-code-for-iphone-ipad)

[How to check Airplane mode in background in iPhone?](https://stackoverflow.com/questions/5814947/how-to-check-airplane-mode-in-background-in-iphone)

but i am not clearly sure if it is possible...

Answer: 
No, you just can't do that.

An app has to adopt to the current network state, not control it.
You would need to access the private API and this would mean, you can't upload the app to the `App Store` because it is not allowed to use the private API in productive mode.