Add Swift code snippet in Xcode 6 - xcode

I want to add the following code to Xcode's user code snippets:
println(" = \()")
I drag it to the code snippets area, I give it a Title, a Summary, a Completion shortcut, and a Completion scope of All
Why doesn't it show up in Xcode's auto-complete suggestions?
I am using Xcode 6.0.1 (6A317)

Your issue is you have a conflicting completion shortcut with one that already exists in XODE: "println". You need to choose something unique. There are some good explanations of the dos and don'ts here:
http://nshipster.com/xcode-snippets/

Related

Xcode 8: custom description in suggestion

I'm trying to have custom description for my functions shown in the suggestions box which shows up as I type said function names, the same way it works for swift functions: e.g the UIActivityIndicatorView.startAnimating() description is shown both in the
QuickHelp menu AND in the completion box
in Xcode 7 I would just add a comment line with the /** */ tags prior to the function declaration and the ide would recognize it accordingly e.g.
but for some reason doing so with Xcode 8 only shows the custom description within the QuickHelp tab of the Utilities menu, and not in the suggestion box.
Is there any suggestion about how I may obtain the same behavior with this new version of Xcode? I would appreciate it a lot!
Hear i found some solution. You need to change User Header Search Path No to Yes under Build settings. And then restart your xcode.
This is working fine for me.
It is because of Indexing.... just go to your project name at the top of navigation and Clean (cmd+shift+k) then come again to the file where you wanna work type any word you will see suggestion popUp. that it..
Other way is that just quit your xcode and open it again and wait for a moment let xcode indexing the files then type any word you will see suggestion popUp. that it..

How to view IOS documentation using Xcode?

Is there a shortcut i can use to display or search Obj-C API?
Say, i'd like to learn more about what IBAction does, i wonder if i can mouse over it and view documentation. Is there a way this can be enabled? A side bar possibly?
Please advise
Option-click a class name and a window will pop up with a description. Click the book icon and the help window will open to that class. Command click to view the h file.
Not that I know off, but you may see the source code at any time, and that has plenty of documentation on the comments.
Command + click on it, then click Show Quick Help
Also there's a keyboard shortcut for opening general documentation list.
Command + Shift +0 (Zero)
In Xcode 4, the Organizer window has a documentation section which can be accessed from the Right sidebar (Quick Help, which is part of the button group to enable the bottom bar (GDB by default) as well as the left sidebar (Class tree/etc) ) of the main Xcode window whenever you click on basically anything in the code (if its a custom method/variable it only tells you where it is defined). However, if it is something like IBAction it will pop up a brief definition as well as a link to open the previously mentioned organizer to the appropriate documentation page.
Within the Quick Help information, click Open in Developer Documentation to access Xcode documentation, which includes more thorough explanations and references to related functions.
You can also access Developer Documentation window from the Xcode Help menu.
Another option is by using the keyboard shortcut Command+Shift+0.

Get Shortcut Recorder working in Xcode 4

Is there any way to have a Shortcut Recorder in Objective-C, where the user can choose the shortcut?
I tried DDHotKey, which worked for me, but with this library users can not choose the shortcut themselves.
Then I tried to implement the Shortcut Recorder, but there I can only work with Xcode 3 because of the ibplugin.
So is there any way to have something like this in Xcode 4 ? :
Mentioned Libraries:
DDHotKey: Here
Shortcut Recorder:Here
IBPlugins do not work in Xcode 4, as you've found out. (File a bug if you want them back) However, this does not prevent you from instantiating the control programmatically...
This is definitely possible--take a look at Jumpcut's source. You might have to change the build settings to use LLVM compiler 3.0 for it to build in Xcode 4, but it's a pretty good example Shortcut Recorder implementation.
There is Shortcut Recorder patch I wrote to use user defined runtime attribute on xcode 4.
You don't need to use ibplugin but just editing NSTextField and its cell.
See issue 58

Delete a User Code Snippet in Xcode

How ??? I can not delete a custom code snippet in Xcode.
I did these steps :
Select needed code snippet and press Delete key.
A pop-up window will appear , and select Delete button.
Remember that : this action cannot be undone.
In the Library select the code snippet you want to delete and press Backspace. A confirm dialog will show up, click "Delete".
Good question, I haven't found a way to do it from within Xcode, but they can be deleted from the Finder. The snippets are stored at ~/Library/Developer/Xcode/UserData/CodeSnippets/. Each one is a separate file that you can delete. Unfortunately they're named with an ID and don't give an indication of which one is which. They're XML files though, so either use a text editor or QuickLook to see the contents and recognise them.
Also, I've had to restart Xcode in order to get the deleted snippets to no longer show up.
I was having trouble, and after messing around a bit it finally worked. You select the user snip and hit the delete key. I tried this multiple times but it didn't work initially. This may be due to me running a prerelease version of Xcode though.
In Xcode 10, select snippet from snippet pop-up dialog.
Then press Shift+⌘
After that just confirm your removal.
Note: This process cannot be undo at this moment.
I was trying forever to delete the useless (to me) C++ ones, but apparently you can only delete the user-created ones in Xcode 10. Bummer.
User-created code snippets are located in
~/Library/Developer/Xcode/UserData/CodeSnippets.
If your XCode UI for deletings snippets doesn't work as in my Xcode 10.2.1, you can navigate to this folder and
either delete all user snippets with rm * or use some kind of cat/grep to find the ones you want to delete.
In xcode select the code snippet
Delete title and shortcut and save it after that select the same and press delete a confirmation box pops up asking you to delete or cancel the code snippet.

How can I make auto-complete display a list in Xcode

How can I use auto-complete in Xcode like I can in Visual Studio and Eclipse? Specifically in VS and Eclipse auto-complete displays a list of choices... while Xcode just displays a single choice.
For example Xcode might suggest "myVariable" when I type in "myV". That's fine but what if I have the following objects in the scope of my function: "myInt1" and "myInt2"? Xcode will suggest "myInt1" when I type "myI" but I'd like to have a list. Or it would be great to, say, tab through the various possibilities like in some shells. So typing "myI" would get the suggestions "myInt1" and then pressing tab would change the suggestion to "myInt2".
Cheers!
Press the escape key when auto-complete makes the first suggestion. This will display the list.
control + space also works in the latest Xcode.

Resources