[英]ObjC to Swift conversion of NSDictionary to NSObject : AnyObject
[英]objc to swift conversion
我有以下需要快速實現的委托函數。
-(void) remoteController:(DJIRemoteController*)rc didUpdateGpsData:(DJIRCGPSData)gpsData;
我不確定該函數應該是什么樣子。
我有以下內容,但我認為這是錯誤的。
@objc func didUpdateGpsData(rc: DJIRemoteController, gpsData: DJIRCGPSData)
{
debugMessage.value = String("RC Time : \(gpsData.mTime)")
}
誰能幫我。
在Swift中,您的委托方法將這樣聲明:
func remoteController(_ rc: DJIRemoteController,
didUpdateGpsData gpsData: DJIRCGPSData)
因此,您可以這樣實現它:
func remoteController(rc: DJIRemoteController,
didUpdateGpsData gpsData: DJIRCGPSData) {
debugMessage.value = String("RC Type: \(gpsData.mTime\)")
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.