简体   繁体   中英

Xcode 7 - Code completion not working with CGRectMake while initializing UIView/UILabel/UIButton in Swift

The auto code completion function doesn't work with my Xcode 7 when I try to type CGRectMake within the initialization of UIView , UILabel , UIButton , etc. If I press the [esc] key, the "No Completions" message is displayed:

使用CGRectMake自动补全

The solution of deleting ~/Library/Developer/Xcode/DerivedData/ doesn't work.

The code completion function still works perfectly at all other places. The only problem I see is with the above UI initializing condition.

This problem does not exist with my Xcode 6.4. Is it possible to be resolved with Xcode 7?

Hi it's looks like bug or something else. I have Xcode 7.3 and code completion still don't work. But if i write the code to constructor it works and Xcode even don't show any syntax errors. If you still need code completion use variable.

Yes, I too have the same issue. Sometime when the code is not running, it is giving auto code but not always. It might be a bug.

You can kind of "fix" this problem by avoiding it. These "XXXMake..." geometry utility functions incl. CGRectMake are outdated.

Try instead typing " CGRect( ".... you should get the new swift like signatures.

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