I want my app to be be usable by only selected audience. Hence I want to password protect my app so that when iphone users download the app and open the app for the first time, they are prompted for the password (this is to make sure only the selected audience will be able to get to main screen of my app).
Does Apple approve my app (in app store and testflight), if I password protect my app(app is written using swift 3)
A company I used to work for did exactly that. You could launch the app, were presented with a login, or given a link to contact the company to become a customer to gain access.
In Itunes Connect, you will see the following section for your app. Here, you must provide a test account that the Apple reviewer can use to properly test your app. There is also a section next to it called notes where you can include information on what a user may do once in the protected area.