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

Escape From Alcatraz: The Brave New World of Xcode Extensions - iOSDevUK Aberystwyth, September 2016

Escape From Alcatraz: The Brave New World of Xcode Extensions - iOSDevUK Aberystwyth, September 2016

My talk/rant about Xcode Extensions given at iOS Dev UK 2016.

Sample code: https://github.com/designatednerd/Xcode8ExtensionExample

C4861b1dfdf3bbb21faec4a1acdf183d?s=128

Ellen Shapiro
PRO

September 06, 2016
Tweet

More Decks by Ellen Shapiro

Other Decks in Technology

Transcript

  1. ESCAPE FROM ALCATRAZ THE BRAVE NEW WORLD OF XCODE EXTENSIONS

    BY ELLEN SHAPIRO IOS DEV UK | ABERYSTWYTH, WALES | SEPTEMBER 2016 DESIGNATEDNERD.COM | SPOTHERO.COM | JUSTHUM.COM | @DESIGNATEDNERD
  2. XCODE IS MY FRENEMY

  3. None
  4. None
  5. None
  6. None
  7. None
  8. None
  9. None
  10. None
  11. None
  12. XCODE AUTO-BASHER

  13. XCODE GHOST !

  14. None
  15. None
  16. None
  17. EXTENSIONS!

  18. EXTENSION GOOD NEWS

  19. OFFICIALLY SUPPORTED

  20. None
  21. DOCUMENTED API

  22. DOCUMENTED API *SORT OF

  23. None
  24. None
  25. MAKING AN EXTENSION

  26. 1. MAKE A HOST MAC APP

  27. 2. ADD AN EXTENSION

  28. None
  29. None
  30. XCSourceEditorExtension

  31. XCSourceEditorCommand

  32. sudo /usr/libexec/xpccachectl THEN TURN IT OFF AND ON AGAIN (ONLY

    ON 10.11 EL CAPITAN, NOT NEEDED ON 10.12 SIERRA)
  33. None
  34. None
  35. TEMPTING THE DEMO GODS https://github.com/designatednerd/Xcode8ExtensionExample

  36. DISTRIBUTION: LIKE ANY OTHER MAC APP

  37. EXTENSION LIMITATIONS (ON A SCALE OF ! TO ")

  38. !: EXTENSIONS ARE SANDBOXED AND CODE-SIGNED

  39. !: NO DEFAULT KEY BINDINGS (USERS HAVE TO SET THEM

    UP INDIVIDUALLY)
  40. ☹: MUST BE INVOKED BY THE USER

  41. !: NO ACCESS TO FILE OR PROJECT STRUCTURE

  42. !: CAN'T EMIT WARNINGS

  43. DUMB THINGS I DID WHICH YOU SHOULD NOT DO

  44. FORGOT TO UNINSTALL OLD PLUGIN TOOLS

  45. None
  46. None
  47. None
  48. FORGOT TO ENABLE CODE SIGNING

  49. THOUGHT CHANGING THE BundleDisplayName WOULD CHANGE THE DISPLAYED NAME

  50. None
  51. !

  52. None
  53. !

  54. LAUNCHED THE WRONG VERSION OF XCODE

  55. None
  56. None
  57. None
  58. OBLIGATORY SUMMARY SLIDE! ▸ Alcatraz is dead in Xcode 8.

    RIP. ▸ Xcode extensions are officially supported, and that's good. ▸ Xcode extensions must have a host macOS app, but that app doesn't actually have to do anything. ▸ Xcode extensions are pretty limited. File radars.
  59. QUESTION TIME!

  60. A FEW QUICK OVERVIEWS! http://www.russbishop.net/xcode-extensions https://littlebitesofcocoa.com/239-creating-an-xcode-source-editor- extension http://allblue.me/xcode/2016/06/28/Build-your-own-Xcode-8-source- editor-extension/ https://videos.raywenderlich.com/screencasts/ios-10-creating-an-

    xcode-8-extension [paid]
  61. LINKS! ▸ WWDC 2016 Session 414: Using and extending the

    Xcode Source Editor: https://developer.apple.com/videos/play/wwdc2016/414/ ▸ Roundup of extensions as of mid-August 2016: https:// theswiftdev.com/2016/08/17/xcode-8-extensions/ ▸ Xcode Ghost details: https://en.wikipedia.org/wiki/XcodeGhost
  62. RADARS TO DUPE! If you'd like any of this functionality,

    please dupe these radars: ▸ Allow callbacks anytime a file with a given extension is edited: http://www.openradar.me/26823522 ▸ No Default key bindings: http://www.openradar.me/28170032 ▸ Can't emit warnings: http://www.openradar.me/28170362