Code inside @available(iOS 13.0, *) doesn't compile in Xcode 10.2 (IOS Swift)

376 views Asked by At

I need to implement some NFC reading related code. That is compatible only in iOS 13, say reading NFC tag UID. So, the problem is that I need write the code in a @available(iOS 13.0, *) block and this code is not supported in Xcode 10.2. My project is live and I need to build it using 10.2. The thing is if I compile the code with Xcode 11 it doesn't give me any error and if I compile it in Xcode 10.2 it gives me this error:

Use of undeclared type 'NFCTagReaderSessionDelegate'.

Here is the code :

@available(iOS 13.0, *)
extension myVC: NFCTagReaderSessionDelegate{
    func tagReaderSessionDidBecomeActive(_ session: NFCTagReaderSession) {
    }

    func tagReaderSession(_ session: NFCTagReaderSession, didInvalidateWithError error: Error) {
    }

    func tagReaderSession(_ session: NFCTagReaderSession, didDetect tags: [NFCTag]) {
    }
}

and all lines of the code is giving the same error as above.

Is there any way to implement this iOS 13 compatible code in Xcode 10?

0

There are 0 answers