AirPlay SwiftUI Views
- File / Swift Packages / Add Package Dependecy
- Search for AirKit by hexagons
- Add Up to Next Major from 1.0.0
import SwiftUI
import AirKit
struct ContentView: View {
var body: some View {
Text("Hello AirPlay")
.airPlay()
}
}
You can also Air a View that is not on the main screen:
Air.play(AnyView(Image(systemName: "airplayvideo")))
To listen to the connection call:
Air.connection { connected in
let isAirPaying: Bool = connected
}
.package(url: "https://github.com/hexagons/AirKit.git", from: "1.0.0")