Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Xcode Gems - Loving the most hated IDE again

Xcode Gems - Loving the most hated IDE again

Xcode is probably the most hated IDE out there.
Programming in any language start with an IDE. Getting to know your IDE makes you productive - so in this talk I'll go back to basics. I'm here to show you how to make Xcode awesome again. I'll talk about setting up Xcode to fit your needs to make you work faster. Keybindings, behaviors, breakpoints, snippets, build phases, themes, Source Editor Extensions and add some external tools like SwiftLint and depcheck to fill in Xcode's blanks.

CocoaHeadsNL

October 19, 2016
Tweet

More Decks by CocoaHeadsNL

Other Decks in Programming

Transcript

  1. Xcode Hidden Gems
    Loving the most hated IDE again (Or bending Xcode to your will)
    © Sidney de Koning, 2016

    View full-size slide

  2. Topics
    • Keybindings
    • Themes & Fonts
    • Behaviours
    • Breakpoints
    • Search
    • Snippets & Text expanding
    • Source Editor Extension (Plugins)
    • External tools: SwiftLint & depcheck
    © Sidney de Koning, 2016

    View full-size slide

  3. Keybindings
    The Most essential ones:
    ⌘⇧O - Quick Open File
    ⌘t - new tab
    ⌘0 / ⌘⌥0 - toggle left/right panel
    ⌘⌥↩ / ⌘↩ - Split Code / Single code View
    ⌘⇧Y - toggle console
    ⌘⇧J - Jump to current file
    ⌘⌥⇧F - Find and Replace all in Workspace.
    ⌘G - Cycle search results
    ctrl⌘J - Look at header / implementation
    ⌘[ or ⌘] - Move line [up/down].
    Demo!
    More here cheatsheetapp.com
    © Sidney de Koning, 2016

    View full-size slide

  4. Search
    • Find text, references and definitions
    • Delete results with backspace, so less clutter
    Demo!
    © Sidney de Koning, 2016

    View full-size slide

  5. Themes
    Find them on codethemes.net
    Path:
    ~/Library/Developer/Xcode/UserData/FontAndColorThemes
    Demo!
    © Sidney de Koning, 2016

    View full-size slide

  6. Fonts
    Use a font that is readable. Maybe one that
    uses ligatures?
    • Fira Code
    • Monoid
    • Hasklig
    • Fixedsys
    More on programmingfonts.org/list
    Demo!
    © Sidney de Koning, 2016

    View full-size slide

  7. Behaviours
    Adaptive Xcode UI.
    Demo!
    © Sidney de Koning, 2016

    View full-size slide

  8. Breakpoints
    • User breakpoints (for all projects)
    • Project breakpoints
    Path:
    ~/Library/Developer/Xcode/UserData/xcdebugger
    Demo!
    © Sidney de Koning, 2016

    View full-size slide

  9. Snippets - Text
    expanding
    • Native to macOS (Preferences + Edit
    㱺 Format 㱺 Substitutions)
    • Xcode - Drag drop code to create snippet
    • Snippets can be shared in team.
    Path:
    ~/Library/Developer/Xcode/UserData/CodeSnippets
    Demo!
    © Sidney de Koning, 2016

    View full-size slide

  10. Snippet Sharing
    cd ~/Library/Developer/Xcode/UserData
    rm -R CodeSnippets
    ln -s {location_of_repo}/ios_codesnippets CodeSnippets
    Full explanation bit.ly/xcsnippets
    © Sidney de Koning, 2016

    View full-size slide

  11. Plugins
    Let's create a plugin.
    XCSourceEditorCommandInvocation
    • buffer
    • lines
    • selection
    © Sidney de Koning, 2016

    View full-size slide

  12. External tools
    • SwiftLint (github.com/realm/SwiftLint)
    • depcheck (github.com/wojteklu/
    depcheck)
    © Sidney de Koning, 2016

    View full-size slide

  13. The End.
    Thank you!
    All code will be on github.com/funky-monkey/XcodeGemsTalk
    Contact me via Twitter:
    @sidneydekoning
    @iheartswiftlang
    © Sidney de Koning, 2016

    View full-size slide

  14. © Sidney de Koning, 2016

    View full-size slide