简体   繁体   中英

Xcode Autocomplete Not Working in SwiftUI

Currently, I am trying to create a pure SwiftUI app. My Xcode version is the most recent (12.4) version.

The problem is whatever I type, Xcode no longer recognize any code. No auto-complete is showing despite I keep pressing Control + space.

The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

This is the error message that appears at the body section. Before, the error message popped up right on the line that error exist. Now, the error just keep coming up at the line:

var body: some View {              * The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions

How can I fix this problem? I want to have autocomplete back as it is necessary for me to code.

I have tried several ways: quitting Xcode, restarting my laptop, deleting Derived Data folder, cleaning build folder, and removing and reinstalling Xcode.

All of these did not work unfortunately...

Thanks if you can tell me any other ways to fix.

I think it was the bug with the current version of Xcode. Using the beta version of Xcode fixed the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM