SwiftUI ignoring import

Pin*_*Gjr 22 import xcode swift

I have just installed Xcode11 and when i try to create new fresh project with SwiftUI check mark selected it returns error.

Not able to build and run successfully.

File 'ContentView.swift' is part of module 'SwiftUI'; ignoring import

ContentView.swift

在此处输入图片说明

Use of undeclared type 'View'

SceneDelegate.swift

在此处输入图片说明

Use of unresolved identifier 'UIHostingController'

I have tried removing all derived data and also set command-line tools to 11

Mat*_*ini 60

Your project is named SwiftUI - please try using a different name.

  • @PinkeshGjr一个应用程序仍然是一个“ Swift模块”-它在实际框架之前被解析为依赖项。因此,“ import SwiftUI”的意思是“导入应用程序模块”,因此Xcode将忽略导入 (2认同)