-2

Okay, so I'm playing around with the nfc capabilities on xcode, and potentially writing them. but as I try to move forward, I find that I'm unable to because my "documentTypes." I have made sure that it is set to target the ios platform, I just don't know what to do now.

screenshot of my code

Yonat
  • 4,382
  • 2
  • 28
  • 37
  • What error are you getting? What is the type of `documentTypes`? – Yonat May 28 '20 at 19:20
  • 3
    @Yonat Post your code as code and not as screenshots. Take a look at [how-to-ask](https://stackoverflow.com/help/how-to-ask). FYI: I'm not the down-voter. – Frankenstein May 28 '20 at 19:22
  • The compiler is correct: `documentTypes` is undeclared. Fix that. – Gereon May 28 '20 at 19:24
  • @Yonat my mistake I meant the poster. – Frankenstein May 28 '20 at 19:31
  • `documetTypes` is not declared. Seems like this question never needed posting. but can be turned to a useful question if it's changed to being about understanding what Compiler in complaining about. – AppleCiderGuy May 28 '20 at 20:58
  • @AppleCiderGuy I declared it wrong! Sorry, I don't usually use Xcode. I've also never made an app before! I appreciate your feedback and thank you for leaving a comment :) – Celeste. May 28 '20 at 23:31
  • 1
    @Frankenstein Thanks so much for the advice! I've never asked a question on stack overflow and I'm a self taught coder. I hope you'll excuse my lack of expertise :) – Celeste. May 28 '20 at 23:33

1 Answers1

0

I can not see any declaration of documentTypes in the code screenshot.

You have to pass an array of documentTypes. You can use the line below.

var docPicker: UIDocumentPickerViewController = UIDocumentPickerViewController(documentTypes: ["public.text"], inMode: UIDocumentPickerMode.Import)