I am developing an ios application using swift. Downloaded the google cast frame work from the below link mentioned. https://developers.google.com/cast/docs/downloads Added this frame work in the application and imported like this: import GoogleCast But I am getting an error saying that "No Such module Google Cast"
I got something working in Swift.
I did not need to import anything.
Did you follow instructions from https://developers.google.com/cast/docs/ios_sender
And also configure Objective-C bridging header.
https://developer.apple.com/library/ios/documentation/swift/conceptual/BuildingCocoaApps/MixandMatch.html
I put the location of file GoogleCast.h
here
I tested this sample code:
class ViewController: UIViewController, GCKDeviceScannerListener {
var scanner = GCKDeviceScanner()!;
func deviceDidComeOnline(device: GCKDevice!) {
println("device found - \(device.friendlyName)");
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
//scanner = GCKDeviceScanner();
println(scanner)
scanner.addListener(self)
scanner.startScan()
}
}
I run this on an Iphone 5s from Xcode and it found my ChromeCast device:
device found - AW
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With