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

Introducing Xcode Editor Extension

Introducing Xcode Editor Extension

2016/06/22 FiNC WWDC振り返り勉強会

0a86666ca90016b2a28289dda921b0d7?s=128

Toshihiro Morimoto

June 22, 2016
Tweet

Transcript

  1. Introducing Xcode Editor Extension 2016/06/22 FiNC WWDCৼΓฦΓษڧձ @dealforest Toshihro Morimoto

  2. ࣗݾ঺հ

  3. None
  4. Έͳ͞Μ iPhone Simulator Λ ͲΕ͘Β͍ೖΕ͍ͯ·͔͢ʁʁ

  5. Xcode Editor Extension, Xcode Source Editor Extension ͷ ͓࿩Λࠓ೔͸͠·͢

  6. ͦͷલʹ

  7. ࡯͠ͷ͍͍Έͳ͞Μ͸ ͓෼͔Γ͔ͱࢥ͍·͢

  8. RIP Xcode Plugin

  9. ൵͍͠ͷͰ ΍͚ञʹ෇͖߹͍ͬͯͩ͘͞

  10. ৑ஊ͸͓͖ͯ͞ ͦΕͰ͸ຊ୊ʹೖ͍͖ͬͯ·͢

  11. Xcode Editor Extension ͞Θͬͨਓ͍·͔͢ʁ

  12. Extension ͍ͬͯ͏໊લ͔Β ͓Θ͔Γ͍͚ͨͩΔΑ͏ʹ OS X Application ʹ෇ଐ͠·͢

  13. ࢖͍ํ • App Store ͔ΒΠϯετʔϧͯ͠ىಈ • ࣗલͰ .app Λ build

    ΋͘͠͸ download ͯ͠ /Applications ͔ ~/Applications ʹ഑ ஔͯ͠ىಈ
  14. Application Ͱ഑෍͢Δ ͱ͍ͬͨײ͡Ͱ͢Ͷ

  15. Extension ʹͨ͠ϝϦοτ • Stability • Security • Speed

  16. ͭ·Δͱ͜Ζ XPC ʹͨ͠ͷͰ ҆શʹͳͬͨΑͬͯ͜ͱͰ͢Ͷ

  17. ࡉ͔͍΋ͷ͸ϦϦʔεϊʔτΛ Έ͍ͯͩ͘͞ https://developer.apple.com/go/?id=xcode8-0-beta-release-notes

  18. XPC ͱ͸ Access a low-level (libSystem) interprocess communication mechanism that

    is based on serialized property lists.
  19. ཁ͢Δʹ binary plist Ͱ ϓϩηεؒ௨৴͢ΔΑ͏ʹͨ͠

  20. Xcode XPC Source Editor Extension Application pid: 1xxxx pid: 2xxxx

  21. ࣮ߦ͞ΕΔλΠϛϯά • Add commands to the source editor • One

    extension, several commands • Edit text • Change selections
  22. ࣮ߦ͞ΕΔλΠϛϯά • ϝχϡʔ͔Β࣮ߦ • ίʔυΛฤू

  23. ϝχϡʔ͔Β࣮ߦ

  24. ίʔυΛฤू #colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)

  25. ίʔυΛฤू #imageLiteral(resourceName: "sun")

  26. ίʔυΛฤूͨ͠ͷΛ؂ࢹͯ͠ Կ͔มߋ͢Δ Extension ͷ࡞Γํ͸ ࣮͸·ͩΑ͘Θ͔ͬͯ·ͤΜ

  27. SwiftLint for Xcode ͕ͦ͏ͳͷ͔΋ʁ ·ͩΩϟονΞοϓ͖͠Εͯ·ͤΜ https://github.com/norio-nomura/SwiftLintForXcode

  28. macOS 10.11 El Capitan Ͱͷ஫ҙ sudo /usr/libexec/xpccachectl & reboot

  29. Xcode Simulator

  30. ࠇ͘ͳͬͨʂʂʂʂ

  31. ͦͷଞ • widget Έ͍ͨʹ opt-out Ͱ͖ͳ͍ • shortcut ͸ Xcode

    ͷઃఆը໘Ͱࣗ෼Ͱ͢Δ • cancel bunner ͸ະ࣮૷
  32. RIP Xcode Plugin

  33. ͱݴ͍·͕࣮ͨ͠͸࢖͑·͢

  34. Xcode8͔Βcode sign ͞ΕΔΑ͏ʹͳͬͨͷ͕ ݪҼͰ Plugin ͕ load ͞Εͳ͘ͳΓ·ͨ͠

  35. ͭ·Γ͸ code sign Λফͤ͹ ࠓ·Ͱ௨Γ࢖͑Δͱ͍͏Θ͚Ͱ͢Ͷ

  36. ͱ͍͏Θ͚Ͱͭ͘Γ·ͨ͠

  37. ※ Objective-C Ͱॻ͔Εͨ Plugin ͔͠ಈ͔ͳ͍͔΋ (ݕূத)

  38. ࣗݾ੹೚Ͱ࣮ߦ͍ͯͩ͘͠͞

  39. https://gist.github.com/dealforest/c5a5362005bce1a4280c34d18a5bc893

  40. ͜ΕΛ࣮ߦ͢Ε͹ ඇূ໌ͷόΠφϦʹͳΓ·͢

  41. https://github.com/alcatraz/Alcatraz/issues/475#issuecomment-226090731

  42. ·ͱΊ ͠͹Β͘ͷؒ Xcode Editor Extension ͸Ͱ͖ Δ͜ͱ͕ݶΒΕ·͢ ͱ͸͍͑ɺ͜ͷ࢓૊Έ͸ૉ੖Β͍͠ͱࢥ͏ ͷͰ௕͍໨ͰݟकΓ·͠ΐ͏

  43. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠