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

GUIの“こちら側”からのデザイン / Designing GUI Face and Face

usagimaru
July 07, 2019

GUIの“こちら側”からのデザイン / Designing GUI Face and Face

GUIの“こちら側”からのデザイン(公開版)

GUIの表現方法ではなく、ユーザーの操作方法やイベントディスパッチの構造に着目してmacOSネイティブインターフェイスのデザインを考えます。CocoaにおけるResponder Chainの仕組みやUIの表現に触れつつ、macOS “らしい” GUIの振る舞い方を考察します。

macOS native Symposium #04
https://macos-native.github.io
https://macos-native.connpass.com/event/127679/

usagimaru

July 07, 2019
Tweet

More Decks by usagimaru

Other Decks in Design

Transcript

  1. © 2019 Satori Maru / @usagimaruma. ιϑτ΢ΣΞσβΠφʔ usagimaru Interface design

    / Interaction design / macOS / iOS @usagimaru @usagimaru @usagimaruma macOS native ίΞϝϯόʔ #macosnative
  2. © 2019 Satori Maru / @usagimaruma. #macosnative Space Drag Adobe

    Photoshop CC 2018 Designing Desktop Interactions – macOS native Symposium #01 https://speakerdeck.com/usagimaru/designing-desktop-interactions #01
  3. © 2019 Satori Maru / @usagimaruma. #macosnative “ͪ͜Βଆ” “͋ͪΒଆ” ࡞༻

    ΧʔιϧҠಈ ΫϦοΫ Ωʔೖྗ Ի੠ೖྗ ࡞༻ άϥϑΟοΫඳը α΢ϯυ࠶ੜ ৼಈ ҹ࡮ User Interface
  4. © 2019 Satori Maru / @usagimaruma. Human-Computer Interaction #macosnative ײ֮ث

    ਫ਼ਆ ਎ମೳྗ ώτ पลػثɾग़ྗ ϋʔυ΢ΣΞ ूੵճ࿏ ιϑτ΢ΣΞ macOS ΞϓϦέʔγϣϯ https://en.wikipedia.org/wiki/File:Linux_kernel_INPUT_OUPUT_evdev_gem_USB_framebuffer.svg ΑΓ࠶ߏ੒ पลػثɾೖྗ Cocoa Core Text Open AL Quartz Core Animation Core Audio Core Image AV Foundation Core Services Metal Darwin ΢Πϯυ΢ UIίϯτϩʔϧ ϝχϡʔ Χʔιϧ α΢ϯυ ϏσΦ Πϝʔδ ςΩετ ΩʔΠϕϯτ Ϛ΢εΠϕϯτ Ի੠ೖྗ ίϯςϯπ IC
  5. © 2019 Satori Maru / @usagimaruma. Human-Computer Interaction #macosnative ײ֮ث

    ਫ਼ਆ ਎ମೳྗ ώτ पลػثɾग़ྗ ϋʔυ΢ΣΞ ूੵճ࿏ ιϑτ΢ΣΞ macOS ΞϓϦέʔγϣϯ https://en.wikipedia.org/wiki/File:Linux_kernel_INPUT_OUPUT_evdev_gem_USB_framebuffer.svg ΑΓ࠶ߏ੒ पลػثɾೖྗ Cocoa Core Text Open AL Quartz Core Animation Core Audio Core Image AV Foundation Core Services Metal Darwin ΢Πϯυ΢ UIίϯτϩʔϧ ϝχϡʔ Χʔιϧ α΢ϯυ ϏσΦ Πϝʔδ ςΩετ ΩʔΠϕϯτ Ϛ΢εΠϕϯτ Ի੠ೖྗ ΦϒδΣΫτ ؍೦ ಺ࡏԽ IC
  6. © 2019 Satori Maru / @usagimaruma. Human-Computer Interaction #macosnative ਫ਼ਆ

    ώτ ιϑτ΢ΣΞ ΞϓϦέʔγϣϯ https://en.wikipedia.org/wiki/File:Linux_kernel_INPUT_OUPUT_evdev_gem_USB_framebuffer.svg ΑΓ࠶ߏ੒ ΦϒδΣΫτ ؍೦ ಺ࡏԽ
  7. © 2019 Satori Maru / @usagimaruma. #macosnative ခ”C ခ”C ခ”C

    Polymorphism ࣅͨੑ࣭ͷΦϒδΣΫτʹ͸ಉ͡࡞༻Λ༩͑ΒΕΔ
  8. © 2019 Satori Maru / @usagimaruma. #macosnative ခ”C ခ”C ခ”C

    Polymorphism ࣅͨੑ࣭ͷΦϒδΣΫτʹ͸ಉ͡࡞༻Λ༩͑ΒΕΔ
  9. © 2019 Satori Maru / @usagimaruma. #macosnative ໊শະઃఆϑΥϧμ Keynote.app Moof.app

    ခ”C ခ”C ခ”C Finder ϑΝΠϧγεςϜͷΦϒδΣΫτ͸ ಉ͡Α͏ʹૢ࡞Ͱ͖Δ << File >>
  10. © 2019 Satori Maru / @usagimaruma. #macosnative ໊শະઃఆϑΥϧμ Keynote.app Moof.app

    ခ”C ခ”C ခ”C Window ခ”C Finder ͦͷ΄͔ͷΦϒδΣΫτ͸ҟͳΔੑ࣭Λ ࣋ͭͨΊɺಉ͡ૢ࡞͸௨༻͠ͳ͍͜ͱ΋ << File >>
  11. © 2019 Satori Maru / @usagimaruma. HIG – Mouse and

    Trackpad Use standard controls and views. Respond to clicks and gestures based on meaning, not the user’s physical movements. In general, respond to gestures in a way that’s consistent with other apps. Avoid redefining systemwide, inter-app gestures. Make sure gestures apply to the appropriate content. Define custom gestures cautiously. Don’t rely on the availability of specific devices and gestures. #macosnative https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/mouse-and-trackpad/ HIG
  12. © 2019 Satori Maru / @usagimaruma. HIG – Mouse and

    Trackpad ඪ४ͷίϯτϩʔϧ෦඼ͱϏϡʔΛ࢖༻͠·͠ΐ͏ɻ Ϣʔβʔͷ਎ମతͳಈ͖Ͱ͸ͳ͘ɺҙຯʹج͍ͮͯδΣενϟʔʹରԠ͠·͠ΐ͏ɻ Ұൠతʹ͸ɺଞͷΞϓϦέʔγϣϯͱಉ͡ํ๏ͰδΣενϟʔʹରԠ͠·͠ΐ͏ɻ γεςϜશମͰద༻͞ΕΔδΣενϟʔΛ࠶ఆٛ͠ͳ͍Ͱ͍ͩ͘͞ɻ δΣενϟʔ͕ίϯςϯπʹରͯ͠ద੾ʹద༻͞ΕΔ͜ͱʹཹҙ͍ͯͩ͘͠͞ɻ ಠࣗͷδΣενϟʔͷఆٛ͸৻ॏʹߦ͍ͬͯͩ͘͞ɻ ಛఆػثʹΑΔδΣενϟʔʹ͸པΒͳ͍Ͱ͍ͩ͘͞ɻ #macosnative https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/mouse-and-trackpad/ HIG
  13. © 2019 Satori Maru / @usagimaruma. #macosnative ΠσΟΦϜ ෳ߹ཁૉ ݪ࢝తཁૉ

    جຊૢ࡞ͱ ϑΟʔυόοΫ ͷ࢓૊Έ Ұൠతͳೖग़ྗૢ࡞΍ه߸ྨ ݪ࢝తཁૉΛ૊Έ߹Θͤͨ΋ͷ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛ૊Έ߹Θͤͨ΋ͷ ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺ௕ඌߴ߂ ༁ ϙΠϯςΟϯά ΫϦοΫ λον υϥοά Ωʔೖྗ Χʔιϧ ςΩετ ը૾ μϒϧΫϦοΫ μϒϧλοϓ ϘλϯͷԡԼ ൣғબ୒ ΩʔόΠϯσΟϯά ςΩετϑΟʔϧυ ϥδΦϘλϯ બ୒ൣғͷදࣔ ԡԼཁૉͷڧௐදࣔ ৽ن࡞੒ ฤू ඳը εΫϩʔϧϏϡʔ φϏήʔγϣϯόʔ ΞϥʔτμΠΞϩά ೖྗ ग़ྗ
  14. © 2019 Satori Maru / @usagimaruma. #macosnative ΠσΟΦϜ ෳ߹ཁૉ ݪ࢝తཁૉ

    جຊૢ࡞ͱ ϑΟʔυόοΫ ͷ࢓૊Έ Ұൠతͳೖग़ྗૢ࡞΍ه߸ྨ ݪ࢝తཁૉΛ૊Έ߹Θͤͨ΋ͷ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛ૊Έ߹Θͤͨ΋ͷ ϙΠϯςΟϯά ΫϦοΫ λον υϥοά Ωʔೖྗ Χʔιϧ ςΩετ ը૾ μϒϧΫϦοΫ μϒϧλοϓ ϘλϯͷԡԼ ൣғબ୒ ΩʔόΠϯσΟϯά ςΩετϑΟʔϧυ ϥδΦϘλϯ બ୒ൣғͷදࣔ ԡԼཁૉͷڧௐදࣔ ৽ن࡞੒ ฤू ඳը εΫϩʔϧϏϡʔ φϏήʔγϣϯόʔ ΞϥʔτμΠΞϩά ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺ௕ඌߴ߂ ༁ ग़ྗ ग़ ྗ ૷ ஔ ͔ Β ͷ ද ݱ ํ ๏ ೖྗ ೖ ྗ ૷ ஔ ͔ Β ͷ ૢ ࡞ ํ ๏
  15. © 2019 Satori Maru / @usagimaruma. #macosnative ΠσΟΦϜ ෳ߹ཁૉ Ұൠతͳೖग़ྗૢ࡞΍ه߸ྨ

    ݪ࢝తཁૉΛ૊Έ߹Θͤͨ΋ͷ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛ૊Έ߹Θͤͨ΋ͷ ϙΠϯςΟϯά ΫϦοΫ λον υϥοά Ωʔೖྗ Χʔιϧ ςΩετ ը૾ μϒϧΫϦοΫ μϒϧλοϓ ϘλϯͷԡԼ ൣғબ୒ ΩʔόΠϯσΟϯά ςΩετϑΟʔϧυ ϥδΦϘλϯ બ୒ൣғͷදࣔ ԡԼཁૉͷڧௐදࣔ ৽ن࡞੒ ฤू ඳը εΫϩʔϧϏϡʔ φϏήʔγϣϯόʔ ΞϥʔτμΠΞϩά ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺ௕ඌߴ߂ ༁ ग़ྗ ೖྗ ग़ ྗ ૷ ஔ ͔ Β ͷ ද ݱ ํ ๏ ೖ ྗ ૷ ஔ ͔ Β ͷ ૢ ࡞ ํ ๏ ݪ࢝తཁૉ جຊૢ࡞ͱ ϑΟʔυόοΫ ͷ࢓૊Έ
  16. © 2019 Satori Maru / @usagimaruma. #macosnative ςΩετ ςΩετ ςΩετ

    ςΩετ ϨΠϠʔબ୒ঢ়ଶ ͷมԽ ςΩετฤूϞʔυ ΁ͷભҠ ςΩετબ୒ঢ়ଶ ͷมԽ ʵ ೖྗૢ࡞ ༩͑Δ࡞༻ ڍಈ က= က? က; ကA ΫϦοΫ ΫϦοΫ μϒϧΫϦοΫ ʵ
  17. © 2019 Satori Maru / @usagimaruma. #macosnative ೖྗ ग़ྗ ʴ

    ခ” mac A ςΩετΛର৅ʹ ͢΂ͯબ୒
  18. © 2019 Satori Maru / @usagimaruma. #macosnative ೖྗ ग़ྗ ʴ

    ခ” A mac ϨΠϠʔΛର৅ʹ ͢΂ͯબ୒ Moof! NSObject
  19. © 2019 Satori Maru / @usagimaruma. #macosnative ςΩετ ςΩετϑΟʔϧυ Χϯόε

    Ϗϡʔ্ͷϨΠϠʔશൠ બ୒͞ΕͨϨΠϠʔ ςΩετϑΟʔϧυ Πϕϯτ௨஌ର৅ ڍಈ mac mac mac ςΩετฤूϞʔυ Χϯόε্ͰϞʔυϨε ϨΠϠʔબ୒ঢ়ଶ Ϟʔυʗঢ়ଶ ςΩετฤूϞʔυ
  20. © 2019 Satori Maru / @usagimaruma. #macosnative ςΩετ ςΩετฤूϞʔυ Χϯόε্ͰϞʔυϨε

    ϨΠϠʔબ୒ঢ়ଶ ςΩετϑΟʔϧυ Χϯόε Ϗϡʔ্ͷϨΠϠʔશൠ બ୒͞ΕͨϨΠϠʔ ςΩετϑΟʔϧυ Ϟʔυʗঢ়ଶ Πϕϯτ௨஌ର৅ ڍಈ ςΩετฤूϞʔυ mac mac mac
  21. © 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSTextView

    NSView firstResponder ϑΥʔΧε͕౰ͨΔ makeFirstResponder(textview) keyWindow NSWindow
  22. © 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSTextView

    NSView keyDown() ΩʔೖྗΛड͚෇͚ NSWindow “͍͋͏↵” “ခ”C”
  23. © 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSTextView

    NSView makeFirstResponder(aView) NSWindow firstResponder
  24. © 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSWindowController

    NSTextView NSView NSWindow delegate NSApplication App delegate keyDown() NSBeep() NSWindow noResponder(for:) Πϕϯτ͕ ड͚औΒΕͳ͍৔߹
  25. © 2019 Satori Maru / @usagimaruma. #macosnative ခ” W window.firstResponder

    NSEvent “ခ”W” textView ử .nextResponder window
  26. © 2019 Satori Maru / @usagimaruma. #macosnative ခ” W window.firstResponder

    NSEvent “ခ”W” textView ử .nextResponder window
  27. © 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ mouseUp(with:) ϨΠϠʔΦϒδΣΫτͷ

    ҠಈॲཧΛऴ͑Δ ʢબ୒ঢ়ଶ͸ҡ࣋ʣ υϥοά&υϩοϓ
  28. © 2019 Satori Maru / @usagimaruma. #macosnative mouseDown(with:) mouseDragged(with:) ΞϦςΟΞ

    Χʔιϧ͕1ptͰ΋ಈ͚͹ɺϨΠϠʔΦϒδΣΫτ͸Ҡಈͯ͠͠·͏ ਓؒͷޡಈ࡞Λى͜͢ՄೳੑΛݕ౼͠ͳ͕ΒɺϢʔβϏϦςΟͷ޲্Λ໨ࢦ͍ͨ͠ ʂ υϥοά&υϩοϓ
  29. © 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ Ҡಈॲཧʹᮢ஋Λઃ͚ͯ υϥοάͷ“͸ͣΈ”Λ཈͑Δ

    mouseDragged(with:) ᮢ஋ະຬͰ͸Ҡಈ͕ൃੜ͠ͳ͍ 5–6pt υϥοά&υϩοϓ
  30. © 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ mouseDragged(with:) mouseUp(with:)

    ͷલʹ υϥοάΛதࢭͨ͘͠ͳͬͨ৔߹ͷߟྀ ʂ ခ” . ခ§ υϥοά&υϩοϓ
  31. © 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ தஅૢ࡞ͷड͚ೖΕ cancelOperation(_:)

    override func cancelOperation(_ sender: Any?) { // υϥοάॲཧΛதࢭͯ͠ mouseDown(with:) ௚લͷঢ়ଶʹ໭͢౳ } ခ” . ခ§ ϨεϙϯμʔνΣΠϯʹͯ keyDown(with:) Λ͏·͘ύε͠ͳ͍ͱ ॲཧ͞Εͳ͍ՄೳੑΞϦ஫ҙ υϥοά&υϩοϓ
  32. © 2019 Satori Maru / @usagimaruma. #macosnative ΠσΟΦϜ ෳ߹ཁૉ ݪ࢝తཁૉ

    جຊૢ࡞ͱ ϑΟʔυόοΫ ͷ࢓૊Έ Ұൠతͳೖग़ྗૢ࡞΍ه߸ྨ ݪ࢝తཁૉΛ૊Έ߹Θͤͨ΋ͷ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛ૊Έ߹Θͤͨ΋ͷ ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺ௕ඌߴ߂ ༁ ೖྗ ग़ྗ গͳ͍छྨ ؆୯ͳૢ࡞ํ๏ େ ͖ ͳ ޮ Ռ
  33. © 2019 Satori Maru / @usagimaruma. #macosnative ෳ߹ཁૉ ݪ࢝తཁૉ جຊૢ࡞ͱ

    ϑΟʔυόοΫ ͷ࢓૊Έ Ұൠతͳೖग़ྗૢ࡞΍ه߸ྨ ݪ࢝తཁૉΛ૊Έ߹Θͤͨ΋ͷ ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺ௕ඌߴ߂ ༁ ೖྗ ग़ྗ গͳ͍छྨ ؆୯ͳૢ࡞ํ๏ େ ͖ ͳ ޮ Ռ ΠσΟΦϜ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛ૊Έ߹Θͤͨ΋ͷ
  34. © 2019 Satori Maru / @usagimaruma. #macosnative ෳ߹ཁૉ ݪ࢝తཁૉ جຊૢ࡞ͱ

    ϑΟʔυόοΫ ͷ࢓૊Έ Ұൠతͳೖग़ྗૢ࡞΍ه߸ྨ ݪ࢝తཁૉΛ૊Έ߹Θͤͨ΋ͷ ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺ௕ඌߴ߂ ༁ ೖྗ ग़ྗ গͳ͍छྨ ؆୯ͳૢ࡞ํ๏ େ ͖ ͳ ޮ Ռ macOS ωΠςΟϒΠϯλʔϑΣΠε “Β͠͞”