Xcode 7.3: import module displayed with strikethrough

After upgrading Xcode to 7.3, I just found that some modules were struck out during import, as in this screenshot:

But after adding the module (so just pressing enter ) everything is fine. What does it mean? The module here is written in Swift and works great.

+48
ios xcode swift
Mar 23 '16 at 14:11
source share
3 answers

This is mistake. We fixed it in 218010af , which should be included in Swift version 2.2.1 and included in 2016-04-12 - a snapshot of the developer .

+37
Mar 25 '16 at 0:45
source share
— -

Strikethrough occurs if you try to import a module that has already been imported by your file or module:

import

In this case, I already imported Foundation (which implicitly imports CoreFoundation), so Xcode tells you that there is no need to import the module again.

+17
Mar 23 '16 at 15:46
source share

I changed the import order

import Foundation import UIKit import LayerKit import Atlas < red line import Foundation import UIKit import Atlas import LayerKit 

Some notes that may be causing this:

  • LayerKit imports the atlas, although LayerKit is the lower-level API Atlas is the user interface layer.

  • Both were imported to Cocoapod

  • The error appeared when I created a second scheme for the application store / Enteprise releases and clears one and switches to another.

  • Removing Derivatives Data did not clear it.
  • So I tried to reorder them, and the red line disappeared
0
Dec 21 '17 at 12:23
source share



All Articles