0

I'm currently working on an old project and each time when I tried to import UIKit or Foundation there is always a strikethrough, this is the only framework I wanted to import. I tested to generate a UIView without import UIKit line and it works...

Is there a build setting can do that? Does anyone know why ? Thanks!

enter image description here

Terry
  • 88
  • 11
  • Are you importing anything else in that file? – Sweeper Jul 23 '21 at 12:38
  • @Sweeper no that's the only framework I imported, it happens in any Swift files of the project – Terry Jul 23 '21 at 12:49
  • See https://stackoverflow.com/a/36182707/1187415: “The strikethrough occurs if you try to import a module that has already been imported by your file or module.” – Martin R Jul 23 '21 at 13:28
  • @MartinR Thanks for the link, but there is only UIKit imported. Besides, I don't really understand "has already been imported by your file or module.”, how to import UIKit by a module? This happens in the main project – Terry Jul 23 '21 at 13:41

1 Answers1

0

It might be linked to the Build Settings titled ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES which, if set to YES, will always embed all the standard libraries (like Foundation, UIKit, WebKit, etc.).

You could disable the setting and test it again.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Ethenyl
  • 666
  • 11
  • 20
  • I've tried to disable it but the problem is still... do you know what is the advantage of enabling this ? – Terry Jul 23 '21 at 20:49