Will Apple reject my iOS app if it has unused UIViewControllers?
The app won't get rejected.

Apple don't browse the source of your app—they're testing the functionality from a user's point of view. Private API detection is left to iTunes Connect.

You should still try to remove unused code from your app to make the app as small as possible for users.