why can't I Import UIKit in my swift file?

Viewed 1205

I can Import UIKit in other files in my project but not in this one why?enter image description here

1 Answers

If Firebase or FirebaseAuth use

@_exported import UIKit

it will import UIKit for you, and therefore you won't be able to import UIKit because it will already be imported. For more information consider what this website says about @_exported:

"If you want to import an external module for your whole module you can use the @_exported keyword before your import. From now the imported module will be available everywhere"

It also says you should probably not use @_exported because it is a private swift attribute.

If this is the case, then UIKit should already be imported, and you should be able to use it without explicitly importing it.

Related