Using MPVolumeView code is as below
let airplay = MPVolumeView(frame:CGRect(x: 0, y: 5, width: 50, height: 25))
airplay.showsRouteButton = true
airplay.showsVolumeSlider = false
airplayView.addSubview(airplay)
Airplay route button is visible for iOS 10.x but not visible in iOS 11. Is it a bug in iOS 11 or we need to change code.