Is there a way to turn off Xcode 8's autocomplete for image names? - ios

Xcode 8 has this new feature that is supposed to suggest image file names when you use UIImage(named:)
In my case it suggests image names even when it doesn't make any sense.
Example:
There is nothing in preferences. I wonder if there is some secret command to disable this part of autocompletion.

No this unfortunately can't be turned off, and nothing states that this is fixed in the Xcode 8.1 Release Notes.
It should either be fixed or you should have the opportunity to turn it off. The functionality is kind of good when it´s used for it´s purpose only, as I describe in this post.
But the issue is that Xcode 8 is inserting images inline in source when it can't possibly make any sense as you mention. For example, if you have a for iteration and type for x in to start a loop and you have any image in the project whose name matches "in" using this syntax.
Annoying issue, that I hope Apple will fix soon, because the feature is good when it´s used for images only.
Update:
Just confirmed that this is still an issue in Xcode 8.1 stable version.
Update:
This functionality remains in Xcode Version 9.0 beta 6 (9M214v)
Update
This seems to be fixed in Xcode 10 now.

It seems to me that the best way to deal with this issue is by using comments (commmand + /). Changing the code to become a comment seems to turn off the autocomplete for image names.
So, you would have basically to switch back and forth between commenting and uncommenting your code (e.g. you find an error, make your code as a comment, fix the error, uncomment your code, check if your changes fixed the issue, and so on.).
Example of the same code with and without being a comment.

Simply update to Xcode 10: the image autocompletion feature has been discontinued:
Code Completion for Swift image literals has been removed in Xcode 10. (38087260)
Source: the Xcode 10 Beta release notes (this note was removed in the final release notes)

Related

Annoying XCode Source Kit bug with multiple targets

I'm struggling with this problem for nearly half a year now with multiple XCode versions and Macs.
I can't reproduce bug steps exactly but the things go off when project has multiple targets like for Mac and iOS.
First of all XCode declines to take #if os into account and always highlight syntax only in one type of sections. E.g. if I have os(iOS) and os(OSX) somewhere it will chose only one and highlight only them.
Same goes for autocompletion. Things just not working in that type of projects.
I really dont know what to do since developmenet process turns into struggling. I dont want to split my project into multiple one, I'm happy with multi-target setup.
Is there a way to fix that?
Almost a year late.
Anyway I faced the same situation where a multi target OSX/iOS application in Xcode did not take into account the #if TARGET_OS_IPHONE conditional and failed to autocomplete method names from framework only showing the iOS variant.
Found a solution, based on this blog entry : you have to clearly state the Framework search path on each target in Build settings
Edit: This line was present in the iOS target settings. I copy/pasted it to the MacOS target in Xcode where it was automatically adjusted to the right path.
Edit 2: Loosely related but if you run in trouble with interface builder picking wrong classe files see this answer I just posted in another old thread.

Xcode 7.3.1 autocomplete code completion not working

Ever since Xcode 7.3 the autocompletion or code completion doesn't work properly.
I have tried:
Deleting Derived Data folder
Clean Targets and Build
Reinstalling Xcode
It does autocomplete after you type it out fully the first time. But if you haven't referenced it once (i.e. like enums) it only shows what you typed out before (not showing full list of enums). Pressing escape doesn't help either.
Any other suggestions? Or anyone else experiencing the same?
Without doing anything, In Build-Settings -> Deployment changing iOS Deployment target from 8.0 to 8.1 resolved the issue for me.
It also works for XCode 6 as mentioned here
Also works on Xcode 8, Simply change the deployment target from iOS 9.0 to iOS 9.1.
Xcode 8 has now fixed this very annoying autocomplete issue. So anyone who is still having this problem, update to Xcode 8.
Edit: Please note, this has not solved for others. So your milage may vary. For me, it has fixed without doing anything extra. But they are using their new 'intelligent' autocomplete. Thinking about it, it could be part of the indexing. Deleting the DerivedData folder could help.
Perhaps, this answer is too late, I'll share it anyway.
First of all, I've uninstalled Alcatraz and all plugins.
Second, I've followed ElonChan's instructions explained on:
Xcode 7.3 autocomplete issues
As a result, autocompletion automagically got back! Thanks #ElonChan.
I hope this answer also solves your problem.
This Happen usually when you are using core Data in your project.(because of automatic indexing of files by xcode not been done) The simple way to avoid this thing is that just click to your project name and clean project come back the same file where you wanna see suggestions type any word and thats it.
There is a way to set shortcut keys for code completion. Xcode -> Preferences -> Key Bindings -> find Show Completions and set whatever non-duplicate keys you want.

Enabling Double Length Pseudolanguage doesn't work in Xcode 7.3

I'm trying to use the Double Length Pseudolanguage to test potential layout problems with other languages. I've enabled Application Language -> Double Length PseudoLanguage in scheme editor but when I run the app in the simulator, none of the strings were doubled. I've tried preview editor in Storyboards and the strings stayed the same.
FYI: I have localized my app to two languages already, I have a Base language (English) and pt-br (Portuguese). All of my hardcoded strings were changed in code to use NSLocalizedString.
Try testing it on a real device.
Looks like this is a bug of the simulator on newer versions of Xcode.
This might sound completely unrelated to the topic, but believe me, I read the question correctly.
If you use AFNetworking pod, go to AFURLSessionManager.m -> _AFURLSessionTaskSwizzling implementation and comment out the line [localDataTask cancel]. If you use CocoaPods you might get a warning that you have to unlock editing of the file. That fixes it for me.
Having the same issue both with Xcode 7.3 and 8 Beta. If you run on iOS 8 simulator this seem to work. Not ideal, but better than nothing.

Xcode 7 crash every time I try to print something in the debugger console

I've searched around and can't find anything on this.
Using Swift 2 and Xcode Version 7.0.1 (7A1001). Every time I execute something in the debugger console, Xcode crashes.
The project is not very big, and has less than 10 third party frameworks.
I can't think of much more information that's relevant, but I'm sure there's more, so please do ask me if there's anything I should add to my question that would help.
I've of course cleaned build and derived data.
It's driving me insane. Thanks!
UPDATE 16/11/12
Submitted rdar://23559366.
How are you maintaining your third party frameworks? Via Carthage?
If so then this is probably your issue: https://github.com/Carthage/Carthage/issues/924
This is an issue if the location of the /Carthage/Build/iOS folder is in a different location to where it was produced (i.e if it was compiled on a different machine and the absolute file path has changed).
A temporary fix would be to run carthage build --no-use-binaries on your machine to rebuild the symbols using the current absolute file path working around the bug.
But if you wasn't using carthage then its probably not your issue so sorry
I had similar problem with Xcode whenever I hit breakpoint.
In case you see this screen right before your Xcode crashes - you are lucky and my fix might save you. All you need to do is open this window and in the Project Navigator, select any file that you want, so that instead of that white blank view you would get your code. After this you are most likely will be able to successfully stop your app at your breakpoint and perform the debug.
I am not sure why this happens, but I suspect that the reason is Debug View Hierarchy mode, which you might have triggered prior to setting you breakpoint and trying to stop at it. At least this is when it happens to me.
I have similar problem earlier.
If you try to print non-optional variable and unfortunately it holds nil value then it breaks/crash. so that make sure declare all possible variables as "Optional type".

Xcode 6-Beta keeps crashing with a SourceKitService Terminated Editor functionality temporarily limited error [duplicate]

This question already has answers here:
SourceKitService Terminated
(34 answers)
Closed 8 years ago.
I have seen other questions with a similar problem but mine looks a bit more serious. Xcode keeps crashing on me. I have no chance to even edit a single character in my code. It is a very simple playground file with some basic code, nothing fancy. I'm not able to do anything at all in the current state.
When Xcode crashes, I hit reopen and the same thing happens again.
Locate the playground file using the Finder, then right click and select 'Show Package Content'. Next select the swift file, right click and open it using your favorite text editor (which must not be Xcode :)).
Once there, either delete its content or surround your code with comments. In the latter case, you can reopen the playground file in Xcode and selectively uncomment code line by line to know which line(s) cause Xcode to crash.
I've verified that there some recurrent patterns in code that almost always makes Xcode to crash, for example, when I use 2 or more custom operators in the same statement. I don't know if it that happens for all custom operators, or it's my specific implementation - either case, I know that I have to avoid that combination. You should take note when you notice a particular combination of code regularly making Xcode crash, and try to avoid it by splitting into multiply lines when possible.
Here's what I did to resolve it. I did reinstall Xcode a couple of times. It looks stable now but I'm not sure till when it would remain so. Looks like a bug to me. I will file it with Apple

Resources