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

Time for Xcode Behavior

Time for Xcode Behavior

Tachibana Kaoru

February 22, 2018
Tweet

More Decks by Tachibana Kaoru

Other Decks in Technology

Transcript

  1. Time for
    Xcode Behavior!
    potato tips 2018/02/22
    Tachibana Kaoru

    View full-size slide

  2. About Me
    • @TachibanaKaoru
    • iOS freelance engineer
    • This years theme : No Travel, No
    Work!
    • Bali όϦౡ
    • Greece ΪϦγϟ

    View full-size slide

  3. Xcode Source Code Extension
    • WWDC 2016 Ͱ঺հ
    • Apple's Xcode official extension!

    View full-size slide

  4. ΍ͬͨʙʂ
    ެࣜϓϥάΠϯͩʂ

    View full-size slide

  5. Ͱ΋;ͨΛ͚͋ͯ
    ΈΔͱ……

    View full-size slide

  6. Xcode Source Code Extension
    • ഑෍΋࡞੒΋σόοά΋େมͩ͠……ɻ
    • ಈ࡞ʹ͔ͳΓ੍ݶ͕͋Δ͠……ɻ
    • GUI΋දࣔͰ͖ͳ͍͠……ɻ
    ʢৄ͘͠͸ɺ@takasek͞Μͷ Xcode Source Editor Extensionͷ
    ੈքΛࢀরʣ

    View full-size slide

  7. ͜͜Ͱ
    Xcode Behavior!

    View full-size slide

  8. Xcode Behaviorͱ͸
    • Xcode ͷmenu͔ΒىಈͰ͖Δಠࣗ
    εΫϦϓτ
    • ଠݹͷੲ͔Β࢖͑·͢ɻ

    View full-size slide

  9. XcodeͷઃఆͷBehaviorsը໘Ͱઃఆ

    View full-size slide

  10. What can it do?
    Xcode Source Code
    Extension
    Xcode Behavior
    XcodeͷΤσΟλʔͰࠓͻΒ
    ͍͍ͯΔϑΝΠϧͷத਎Λม
    ߋ͢Δ͜ͱ͔͠Ͱ͖ͳ͍ɻ
    Xcode͔Βಠཱͯ͠ಈ࡞͢Δ
    εΫϦϓτͳͷͰɺͳΜͰ΋
    Ͱ͖Δɻ

    View full-size slide

  11. context from Xcode...
    Xcode Source Code
    Extension
    Xcode Behavior
    XcodeͰ։͍͍ͯΔϑΝΠϧ
    ͷத਎ͷΈऔಘͰ͖Δɻ
    ؀ڥม਺ͰࠓXcodeͰ։͍ͯ
    ͍ΔϓϩδΣΫτ͕Θ͔Δɻ

    View full-size slide

  12. Editing, Distributing...
    Xcode Source Code
    Extension
    Xcode Behavior
    ࡞੒΋഑෍΋มߋ΋ෳࡶ ࣗ෼Ͱॻ͍ͨεΫϦϓτΛࣗ
    ݾ੹೚Ͱ࢖͏εΩʔϜͳͷ
    Ͱɺ࡞੒΋഑෍΋มߋ΋ָ

    View full-size slide

  13. show GUI
    Xcode Source Code
    Extension
    Xcode Behavior
    GUIΛදࣔͰ͖ͳ͍ GUIΛදࣔͰ͖ΔɻAppKit΋
    ΋ͪΖΜՄɻ

    View full-size slide

  14. Programming Language
    Xcode Source Code
    Extension
    Xcode Behavior
    XcodeͰίϯύΠϧͰ͖Δݴ
    ޠͷΈ
    εΫϦϓτͱͯ͠࢖͑Δݴޠ
    ͳΒͳΜͰ΋ՄɻSwiftͰ΋ɺ
    γΣϧεΫϦϓτͰ΋ɺapple
    scriptͰ΋ɺrubyͰ΋ɻ

    View full-size slide

  15. Hello World with Apple Script
    #!/usr/bin/osascript
    set theDialogText to "Hello World!"
    display dialog theDialogText

    View full-size slide

  16. ͯ͞ɺ͜͜Ͱɺ࣮ϓϩδΣΫτͰ࢖͑
    ΔXcode BehaviorͷαϯϓϧΛݟͯ
    Έ·͠ΐ͏ɻ

    View full-size slide

  17. Markdown in Xcode

    View full-size slide

  18. Markdown in Apple Sample
    • preview mode

    View full-size slide

  19. Markdown in my project...
    • not preview mode!

    View full-size slide

  20. to change makrdown's preiew mode
    ϓϩδΣΫτ಺ʹಛఆͷ໊લͷplistϑΝΠϧΛ͓͘ͱɺXcode
    ͰϚʔΫμ΢ϯϑΝΠϧ͕ϓϨϏϡʔϞʔυͰදࣔ͞ΕΔΑ͏
    ʹͳΓ·͢ɻ
    Xcode9ͰͷMarkdownϨϯμϦϯά - http://www.toyship.org/
    archives/2541

    View full-size slide

  21. script to change preview mode of
    markdown in Xcode
    #!/usr/bin/swift
    import Foundation
    let env = ProcessInfo.processInfo.environment
    let manager = FileManager.default
    let fileNakami = "...."
    if let pathValue = env["XcodeProjectPath"] as? String{
    var fileURL = URL(fileURLWithPath: pathValue)
    fileURL.appendPathComponent(".xcodesamplecode.plist")
    try! fileNakami.write(to: fileURL, atomically: true, encoding: String.Encoding.utf8)
    }
    https://gist.github.com/TachibanaKaoru/
    4ffa5dda9b86b4f0ef1a02e064ba34e9

    View full-size slide

  22. ·ͱΊ
    • Xcode Behaviorศརʂ
    • ଠݹͷੲ͔Β࢖͑ΔٕͰ͕͢ɺࠓͦ͜Έͳ͓͞ΕΔ΂͖ʂ

    View full-size slide