X is not an element type of Y

I am having problems with the spacing between module names in a fast project.

I tried this in a new project and everything works fine:

I have 2 modules that contain the same class name, and I can refer to the class from Module.Classwithout problems.

I have an existing quick project, and I cannot get this to work. I keep getting an error

enter image description here

So, as you can see if I'm trying to work with the Scope module, everything works fine.

(And yes, I tried with and without adding .Type).

So, I assume there is something in the compiler settings. The only thing I can think of is that my LocationMessage class is not defined in the main "class" of the DataManager, but in another file.

But I really can’t make the heads or tails of what is happening. Any suggestions?

Project structure

Structure: DataManager

  • DataManager.swift
  • LocationMessages.swift

Framework: ReferenceTest

  • File.swift

So, my problem is that in File.swiftI am trying to refer to a class defined in LocationMessages.swiftinside the ISDataManager.framework class public

@objc(DMLocationMessage)
final public class LocationMessage : ParsedMessage {
+4
source share
1 answer

There is probably in your code class/struct/enum DataManagerthat is hiding the module DataManager. The error indicates that it cannot find LocationManagerin the type DataManager where it should read the module .

, , import. LocationMessage.Type , .

all X, . XDataManager. Apple, (, CocoaPods) (, ).
X , , .

+3

Source: https://habr.com/ru/post/1619058/


All Articles