What are some Xcode tips and tricks that can make iOS and Mac developers more productive?
-
When you're new to Xcode, you see all these features, but since there's so much to learn, you kind of put them aside and forget about them. Out of all the "advanced" Xcode features, which ones do you find most useful?
-
Answer:
In order of most useful. Many of these tips are fairly basic, but often ignored: Open a file directly COMMAND + SHIFT + O It's super fast, and smart about camel case. You can search "NearbyFriends", and it'll bring up results like NearbyBlahFriends.h . Switch between header and .m/.mm file CONTROL + COMMAND + UP (or DOWN) arrow. This is more useful than the "counterparts" view, since it is quick and frees up the right side for like the Comparison panel, etc. When used in conjunction with counterparts, it has the effect of swapping panes, which makes sense and is awesome. Go back or forward in your file history CONTROL + COMMAND + LEFT / RIGHT arrow. This is quicker than mouse swipes: it'll save you from carpal tunnel, and there's no animation. "Recent files" Seeing where a particular function is called Put your cursor on a function name, and see the callers menu. Search and Filter Sometimes you're looking for a string in some UI, like "Done", and you naively type that into the search panel. You get like 1000 results. You do remember, however, that the file name has the word "Nearby" in it. Type that into the filter at the bottom, it's quick! Limit issues in the Issue Navigator to only Errors Depending on the current state of your overall code base (and Xcode's hormonal imbalance at the moment), the issue navigator can easily get slammed with warnings. Turn that exclamation point button on to see the errors. Refactoring Tools Select some code in a method, and go into this menu: This is incredibly slow for me given our gigantic code base, so I only use it for very large refactors, but if you're working on a newer project, it could be useful for you. Extract will take some highlighted code in a method, and extract it into a newer method, properly passing and declaring the necessary arguments to the new method. Rename will rename symbols, update references to them, and where applicable, change file names along with file names in #import header statements. Those are the most useful actions in the Refactor sub-menu, and I dearly miss this ability from my Java / Eclipse days. The following are useful if and only if you are using git... Comparison View Very useful, especially before you do a commit, and send it off for review. Viewing history in Comparison View This is between the two panes in comparison view. You click that history icon at the bottom, then you can move the left and right arrow carets up and down. "Show only files with source control status" This is especially useful when you are about to do a commit, and want to quickly review your changes. Use this in conjunction with the Comparison view. Select the "Project Navigator" tab in the left side bar and hit that button (shown in blue in the screenshot). Blame View Beyond knowing who touched which line last, what's also great is that if there are links in the commit description, they're clickable! This is very useful at Facebook, given our workflows with our code review system ( http://phabricator.org/ ). Note that the screenshots shown are minimal since I didn't want to leak any Facebook source code, which is all I have handy ATM. :-) . See also my answer on 3rd party tools for iOS devs:
Amir Memon at Quora Visit the source
Other answers
Great answer by @Amir Memon. I'd also add to that list: Even more shortcuts:cmd + click = jump to the definition option + click = show documentation hint esc = show autocompletion ctrl + `.` = select next option in autocompletion ctrl + shift + `.` = select previous option in autocompletion Breakpoints:Set breakpoint on: objc_exception_throw Also, you can read more about breakpoints here: http://natashatherobot.com/xcode-debugging-user-breakpoints/ LLDB:This is quite complicated for newbies. I'd suggest to read this post if you want to be more fluent in the topic: https://www.objc.io/issues/19-debugging/lldb-debugging/ Creating behaviours:Xcode -> Preferences -> Behaviours You can e.g. set up the environment to dismiss all side panels in code, show right panel in IB, show console & variables in debug etc. Installing the right plugins:Quite often touched topic. Install Alcatraz and find best plugins for you. In my case these are(@): DerivedDataExterminator, FuzzyAutocomplete, KSImageNamed, OMColorSense, SCXcodeSwitchExpander, XToDo, showInGitHub, VVDocumenter, xcodeBoost Testing:Double status bar in simulator: It's quite important that all of your views layout properly with incoming call status bar. You can test it in simulator under -> hardware -> toggle in-call status bar Memory warnings : -> hardware -> simulate memory warning There are quite many other ideas in SOF: http://stackoverflow.com/questions/146297/hidden-features-of-xcode
Natalia Osiecka
Greetings,I'm happy to answer this question.There are a good article: "Speed up with Xcode", where described features which can help you to be more productive.http://code.tutsplus.com/articles/getting-up-to-speed-with-xcode-6--cms-22287 Also, I recommend to use "Alcatraz" package manager for Xcode. It contain a tonn of usefull plugins.List of best plugins:https://maniacdev.com/xcode-plugins Good luck:) Roll'n'Code teamhttp://rollncode.com
Anastasia Minak
Related Q & A:
- What is a great hobby from which you can make money?Best solution by Yahoo! Answers
- What are some ways I can make a little money?Best solution by Yahoo! Answers
- What are all the possible "smileys" that you can make on Facebook Chat?Best solution by wikihow.com
- What can make stomach ulcers better?Best solution by answers.yahoo.com
- What are some part time jobs I can make a living by?Best solution by wikihow.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.