2016/06/22 FiNC WWDC振り返り勉強会
Introducing Xcode Editor Extension2016/06/22 FiNC WWDCৼΓฦΓษڧձ@dealforestToshihro Morimoto
View Slide
ࣗݾհ
Έͳ͞ΜiPhone Simulator ΛͲΕ͘Β͍ೖΕ͍ͯ·͔͢ʁʁ
Xcode Editor Extension,Xcode Source Editor Extension ͷ͓Λࠓ͠·͢
ͦͷલʹ
͠ͷ͍͍Έͳ͞Μ͓͔Γ͔ͱࢥ͍·͢
RIP Xcode Plugin
൵͍͠ͷͰ͚ञʹ͖߹͍ͬͯͩ͘͞
ஊ͓͖ͯͦ͞ΕͰຊʹೖ͍͖ͬͯ·͢
Xcode Editor Extension͞Θͬͨਓ͍·͔͢ʁ
Extension ͍ͬͯ͏໊લ͔Β͓Θ͔Γ͍͚ͨͩΔΑ͏ʹOS X Application ʹଐ͠·͢
͍ํ• App Store ͔ΒΠϯετʔϧͯ͠ىಈ• ࣗલͰ .app Λ build ͘͠ downloadͯ͠ /Applications ͔ ~/Applications ʹஔͯ͠ىಈ
Application Ͱ͢Δͱ͍ͬͨײ͡Ͱ͢Ͷ
Extension ʹͨ͠ϝϦοτ• Stability• Security• Speed
ͭ·Δͱ͜Ζ XPC ʹͨ͠ͷͰ҆શʹͳͬͨΑͬͯ͜ͱͰ͢Ͷ
ࡉ͔͍ͷϦϦʔεϊʔτΛΈ͍ͯͩ͘͞https://developer.apple.com/go/?id=xcode8-0-beta-release-notes
XPC ͱAccess a low-level (libSystem) interprocesscommunication mechanism that is based onserialized property lists.
ཁ͢Δʹ binary plist Ͱϓϩηεؒ௨৴͢ΔΑ͏ʹͨ͠
XcodeXPCSource Editor ExtensionApplicationpid: 1xxxxpid: 2xxxx
࣮ߦ͞ΕΔλΠϛϯά• Add commands to the source editor• One extension, several commands• Edit text• Change selections
࣮ߦ͞ΕΔλΠϛϯά• ϝχϡʔ͔Β࣮ߦ• ίʔυΛฤू
ϝχϡʔ͔Β࣮ߦ
ίʔυΛฤू#colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)
ίʔυΛฤू#imageLiteral(resourceName: "sun")
ίʔυΛฤूͨ͠ͷΛࢹͯ͠Կ͔มߋ͢Δ Extension ͷ࡞Γํ࣮·ͩΑ͘Θ͔ͬͯ·ͤΜ
SwiftLint for Xcode ͕ͦ͏ͳͷ͔ʁ·ͩΩϟονΞοϓ͖͠Εͯ·ͤΜhttps://github.com/norio-nomura/SwiftLintForXcode
macOS 10.11 El Capitan Ͱͷҙsudo /usr/libexec/xpccachectl & reboot
Xcode Simulator
ࠇ͘ͳͬͨʂʂʂʂ
ͦͷଞ• widget Έ͍ͨʹ opt-out Ͱ͖ͳ͍• shortcut Xcode ͷઃఆը໘ͰࣗͰ͢Δ• cancel bunner ະ࣮
ͱݴ͍·͕࣮ͨ͑͠·͢
Xcode8͔Βcode sign ͞ΕΔΑ͏ʹͳͬͨͷ͕ݪҼͰ Plugin ͕ load ͞Εͳ͘ͳΓ·ͨ͠
ͭ·Γ code sign Λফͤࠓ·Ͱ௨Γ͑Δͱ͍͏Θ͚Ͱ͢Ͷ
ͱ͍͏Θ͚Ͱͭ͘Γ·ͨ͠
※ Objective-C Ͱॻ͔ΕͨPlugin ͔͠ಈ͔ͳ͍͔(ݕূத)
ࣗݾͰ࣮ߦ͍ͯͩ͘͠͞
https://gist.github.com/dealforest/c5a5362005bce1a4280c34d18a5bc893
͜ΕΛ࣮ߦ͢Εඇূ໌ͷόΠφϦʹͳΓ·͢
https://github.com/alcatraz/Alcatraz/issues/475#issuecomment-226090731
·ͱΊ͠Β͘ͷؒ Xcode Editor Extension Ͱ͖Δ͜ͱ͕ݶΒΕ·͢ͱ͍͑ɺ͜ͷΈૉΒ͍͠ͱࢥ͏ͷͰ͍ͰݟकΓ·͠ΐ͏
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠