Share
Embed
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
Transcript
87 slides
-
@usagimaruma GUI ͷ “ͪ͜Βଆ” ͔ΒͷσβΠϯ macos-native.github.io © 2019 Satori Maru
/ @usagimaruma. macOS native Symposium #04 #macosnative -
© 2019 Satori Maru / @usagimaruma. ιϑτΣΞσβΠφʔ usagimaru Interface design
/ Interaction design / macOS / iOS @usagimaru @usagimaru @usagimaruma macOS native ίΞϝϯόʔ #macosnative -
© 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 -
© 2019 Satori Maru / @usagimaruma. #macosnative “ͪ͜Βଆ” “͋ͪΒଆ” ࡞༻
࡞༻ User Interface -
© 2019 Satori Maru / @usagimaruma. #macosnative “ͪ͜Βଆ” “͋ͪΒଆ” ࡞༻
ΧʔιϧҠಈ ΫϦοΫ Ωʔೖྗ Իೖྗ ࡞༻ άϥϑΟοΫඳը αϯυ࠶ੜ ৼಈ ҹ User Interface -
© 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 -
© 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 -
© 2019 Satori Maru / @usagimaruma. Human-Computer Interaction #macosnative ਫ਼ਆ
ώτ ιϑτΣΞ ΞϓϦέʔγϣϯ https://en.wikipedia.org/wiki/File:Linux_kernel_INPUT_OUPUT_evdev_gem_USB_framebuffer.svg ΑΓ࠶ߏ ΦϒδΣΫτ ؍೦ ࡏԽ -
© 2019 Satori Maru / @usagimaruma. #macosnative ခC ခC ခC
Polymorphism ࣅͨੑ࣭ͷΦϒδΣΫτʹಉ͡࡞༻Λ༩͑ΒΕΔ -
© 2019 Satori Maru / @usagimaruma. #macosnative ခC ခC ခC
Polymorphism ࣅͨੑ࣭ͷΦϒδΣΫτʹಉ͡࡞༻Λ༩͑ΒΕΔ -
© 2019 Satori Maru / @usagimaruma. #macosnative ໊শະઃఆϑΥϧμ Keynote.app Moof.app
ခC ခC ခC Finder ϑΝΠϧγεςϜͷΦϒδΣΫτ ಉ͡Α͏ʹૢ࡞Ͱ͖Δ << File >> -
© 2019 Satori Maru / @usagimaruma. #macosnative ໊শະઃఆϑΥϧμ Keynote.app Moof.app
ခC ခC ခC Window ခC Finder ͦͷ΄͔ͷΦϒδΣΫτҟͳΔੑ࣭Λ ࣋ͭͨΊɺಉ͡ૢ࡞௨༻͠ͳ͍͜ͱ << File >> -
© 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 -
© 2019 Satori Maru / @usagimaruma. HIG – Mouse and
Trackpad ඪ४ͷίϯτϩʔϧ෦ͱϏϡʔΛ༻͠·͠ΐ͏ɻ Ϣʔβʔͷମతͳಈ͖Ͱͳ͘ɺҙຯʹج͍ͮͯδΣενϟʔʹରԠ͠·͠ΐ͏ɻ ҰൠతʹɺଞͷΞϓϦέʔγϣϯͱಉ͡ํ๏ͰδΣενϟʔʹରԠ͠·͠ΐ͏ɻ γεςϜશମͰద༻͞ΕΔδΣενϟʔΛ࠶ఆٛ͠ͳ͍Ͱ͍ͩ͘͞ɻ δΣενϟʔ͕ίϯςϯπʹରͯ͠దʹద༻͞ΕΔ͜ͱʹཹҙ͍ͯͩ͘͠͞ɻ ಠࣗͷδΣενϟʔͷఆٛ৻ॏʹߦ͍ͬͯͩ͘͞ɻ ಛఆػثʹΑΔδΣενϟʔʹཔΒͳ͍Ͱ͍ͩ͘͞ɻ #macosnative https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/mouse-and-trackpad/ HIG -
ඪ४ͷίϯτϩʔϧ෦ͱϏϡʔΛ༻͠·͠ΐ͏ɻ Ϣʔβʔͷମతͳಈ͖Ͱͳ͘ɺҙຯʹج͍ͮͯδΣενϟʔʹରԠ͠·͠ΐ͏ɻ ҰൠతʹɺଞͷΞϓϦέʔγϣϯͱಉ͡ํ๏ͰδΣενϟʔʹରԠ͠·͠ΐ͏ɻ γεςϜશମͰద༻͞ΕΔδΣενϟʔΛ࠶ఆٛ͠ͳ͍Ͱ͍ͩ͘͞ɻ δΣενϟʔ͕ίϯςϯπʹରͯ͠దʹద༻͞ΕΔ͜ͱʹཹҙ͍ͯͩ͘͠͞ɻ ಠࣗͷδΣενϟʔͷఆٛ৻ॏʹߦ͍ͬͯͩ͘͞ɻ ಛఆػثʹΑΔδΣενϟʔʹཔΒͳ͍Ͱ͍ͩ͘͞ɻ © 2019 Satori
Maru / @usagimaruma. HIG – Mouse and Trackpad #macosnative https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/mouse-and-trackpad/ HIG Ұ ؏ ੑ -
ඪ४ͷίϯτϩʔϧ෦ͱϏϡʔΛ༻͠·͠ΐ͏ɻ Ϣʔβʔͷମతͳಈ͖Ͱͳ͘ɺҙຯʹج͍ͮͯδΣενϟʔʹରԠ͠·͠ΐ͏ɻ ҰൠతʹɺଞͷΞϓϦέʔγϣϯͱಉ͡ํ๏ͰδΣενϟʔʹରԠ͠·͠ΐ͏ɻ γεςϜશମͰద༻͞ΕΔδΣενϟʔΛ࠶ఆٛ͠ͳ͍Ͱ͍ͩ͘͞ɻ δΣενϟʔ͕ίϯςϯπʹରͯ͠దʹద༻͞ΕΔ͜ͱʹཹҙ͍ͯͩ͘͠͞ɻ ಠࣗͷδΣενϟʔͷఆٛ৻ॏʹߦ͍ͬͯͩ͘͞ɻ ಛఆػثʹΑΔδΣενϟʔʹཔΒͳ͍Ͱ͍ͩ͘͞ɻ © 2019 Satori
Maru / @usagimaruma. HIG – Mouse and Trackpad #macosnative https://developer.apple.com/design/human-interface-guidelines/macos/user-interaction/mouse-and-trackpad/ HIG Ұ ؏ ੑ ର ͱ ͷ ૢ ࡞ ํ ๏ ʹ ؔ ͢ Δ ϙ Ϧ Ϟ ʔ ϑ ỹ ζ Ϝ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΠσΟΦϜ ෳ߹ཁૉ ݪ࢝తཁૉ
جຊૢ࡞ͱ ϑΟʔυόοΫ ͷΈ Ұൠతͳೖग़ྗૢ࡞ه߸ྨ ݪ࢝తཁૉΛΈ߹Θͤͨͷ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛΈ߹Θͤͨͷ ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺඌߴ߂ ༁ ϙΠϯςΟϯά ΫϦοΫ λον υϥοά Ωʔೖྗ Χʔιϧ ςΩετ ը૾ μϒϧΫϦοΫ μϒϧλοϓ ϘλϯͷԡԼ ൣғબ ΩʔόΠϯσΟϯά ςΩετϑΟʔϧυ ϥδΦϘλϯ બൣғͷදࣔ ԡԼཁૉͷڧௐදࣔ ৽ن࡞ ฤू ඳը εΫϩʔϧϏϡʔ φϏήʔγϣϯόʔ ΞϥʔτμΠΞϩά ೖྗ ग़ྗ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΠσΟΦϜ ෳ߹ཁૉ ݪ࢝తཁૉ
جຊૢ࡞ͱ ϑΟʔυόοΫ ͷΈ Ұൠతͳೖग़ྗૢ࡞ه߸ྨ ݪ࢝తཁૉΛΈ߹Θͤͨͷ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛΈ߹Θͤͨͷ ϙΠϯςΟϯά ΫϦοΫ λον υϥοά Ωʔೖྗ Χʔιϧ ςΩετ ը૾ μϒϧΫϦοΫ μϒϧλοϓ ϘλϯͷԡԼ ൣғબ ΩʔόΠϯσΟϯά ςΩετϑΟʔϧυ ϥδΦϘλϯ બൣғͷදࣔ ԡԼཁૉͷڧௐදࣔ ৽ن࡞ ฤू ඳը εΫϩʔϧϏϡʔ φϏήʔγϣϯόʔ ΞϥʔτμΠΞϩά ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺඌߴ߂ ༁ ग़ྗ ग़ ྗ ஔ ͔ Β ͷ ද ݱ ํ ๏ ೖྗ ೖ ྗ ஔ ͔ Β ͷ ૢ ࡞ ํ ๏ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΠσΟΦϜ ෳ߹ཁૉ Ұൠతͳೖग़ྗૢ࡞ه߸ྨ
ݪ࢝తཁૉΛΈ߹Θͤͨͷ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛΈ߹Θͤͨͷ ϙΠϯςΟϯά ΫϦοΫ λον υϥοά Ωʔೖྗ Χʔιϧ ςΩετ ը૾ μϒϧΫϦοΫ μϒϧλοϓ ϘλϯͷԡԼ ൣғબ ΩʔόΠϯσΟϯά ςΩετϑΟʔϧυ ϥδΦϘλϯ બൣғͷදࣔ ԡԼཁૉͷڧௐදࣔ ৽ن࡞ ฤू ඳը εΫϩʔϧϏϡʔ φϏήʔγϣϯόʔ ΞϥʔτμΠΞϩά ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺඌߴ߂ ༁ ग़ྗ ೖྗ ग़ ྗ ஔ ͔ Β ͷ ද ݱ ํ ๏ ೖ ྗ ஔ ͔ Β ͷ ૢ ࡞ ํ ๏ ݪ࢝తཁૉ جຊૢ࡞ͱ ϑΟʔυόοΫ ͷΈ -
© 2019 Satori Maru / @usagimaruma. #macosnative ςΩετ ςΩετ ςΩετ
ςΩετ ϨΠϠʔબঢ়ଶ ͷมԽ ςΩετฤूϞʔυ ͷભҠ ςΩετબঢ়ଶ ͷมԽ ʵ ೖྗૢ࡞ ༩͑Δ࡞༻ ڍಈ က= က? က; ကA ΫϦοΫ ΫϦοΫ μϒϧΫϦοΫ ʵ -
© 2019 Satori Maru / @usagimaruma. #macosnative ೖྗ ग़ྗ ʴ
ခ mac A ςΩετΛରʹ ͯ͢બ -
© 2019 Satori Maru / @usagimaruma. #macosnative ೖྗ ग़ྗ ʴ
ခ A mac ϨΠϠʔΛରʹ ͯ͢બ Moof! NSObject -
© 2019 Satori Maru / @usagimaruma. #macosnative ςΩετ ςΩετϑΟʔϧυ Χϯόε
Ϗϡʔ্ͷϨΠϠʔશൠ બ͞ΕͨϨΠϠʔ ςΩετϑΟʔϧυ Πϕϯτ௨ର ڍಈ mac mac mac ςΩετฤूϞʔυ Χϯόε্ͰϞʔυϨε ϨΠϠʔબঢ়ଶ Ϟʔυʗঢ়ଶ ςΩετฤूϞʔυ -
© 2019 Satori Maru / @usagimaruma. #macosnative ςΩετ ςΩετฤूϞʔυ Χϯόε্ͰϞʔυϨε
ϨΠϠʔબঢ়ଶ ςΩετϑΟʔϧυ Χϯόε Ϗϡʔ্ͷϨΠϠʔશൠ બ͞ΕͨϨΠϠʔ ςΩετϑΟʔϧυ Ϟʔυʗঢ়ଶ Πϕϯτ௨ର ڍಈ ςΩετฤूϞʔυ mac mac mac -
© 2019 Satori Maru / @usagimaruma. Responder Chain ʬͨΒ͍ճ͠ͷύλʔϯʭ ϝοηʔδͷचܨ͗ܦ࿏Λܗ͠ɺͷॴࡏΛΦϒδΣΫτࣗʹܾΊͤ͞Δ
#macosnative nextResponder nextResponder nextResponder nextResponder firstResponder -
© 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSTextView
NSView firstResponder ϑΥʔΧε͕ͨΔ makeFirstResponder(textview) keyWindow NSWindow -
© 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSTextView
NSView keyDown() ΩʔೖྗΛड͚͚ NSWindow “͍͋͏↵” “ခC” -
© 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSTextView
NSView makeFirstResponder(aView) NSWindow firstResponder -
© 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSTextView
NSView keyDown() keyDown() NSWindow -
© 2019 Satori Maru / @usagimaruma. #macosnative NSViewController NSView NSWindowController
NSTextView NSView NSWindow delegate NSApplication App delegate keyDown() NSBeep() NSWindow noResponder(for:) Πϕϯτ͕ ड͚औΒΕͳ͍߹ -
© 2019 Satori Maru / @usagimaruma. #macosnative ခ A window.firstResponder
NSEvent “ခA” textView ử -
© 2019 Satori Maru / @usagimaruma. #macosnative ခ W window.firstResponder
NSEvent “ခW” textView ử .nextResponder window -
© 2019 Satori Maru / @usagimaruma. #macosnative ခ W window.firstResponder
NSEvent “ခW” textView ử .nextResponder window -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ mouseDown(with:) બঢ়ଶʹ
isHighlighted = true υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ mouseDown(with:) mouseDragged(with:)
બঢ়ଶʹ isHighlighted = true υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ mouseUp(with:) ϨΠϠʔΦϒδΣΫτͷ
ҠಈॲཧΛऴ͑Δ ʢબঢ়ଶҡ࣋ʣ υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative mouseDown(with:) mouseDragged(with:) ΞϦςΟΞ
Χʔιϧ͕1ptͰಈ͚ɺϨΠϠʔΦϒδΣΫτҠಈͯ͠͠·͏ ਓؒͷޡಈ࡞Λى͜͢ՄೳੑΛݕ౼͠ͳ͕ΒɺϢʔβϏϦςΟͷ্Λࢦ͍ͨ͠ ʂ υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ ҠಈॲཧʹᮢΛઃ͚ͯ υϥοάͷ“ͣΈ”Λ͑Δ
mouseDragged(with:) ᮢະຬͰҠಈ͕ൃੜ͠ͳ͍ 5–6pt υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ mouseDragged(with:) ᮢΛߟྀͭͭ͠
Ϛε࠲ඪͷมԽྔΛө υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ mouseUp(with:) ϨΠϠʔΦϒδΣΫτͷ
ҠಈॲཧΛऴ͑Δʢબঢ়ଶҡ࣋ʣ υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ mouseDragged(with:) mouseUp(with:)
ͷલʹ υϥοάΛதࢭͨ͘͠ͳͬͨ߹ͷߟྀ ʂ ခ . ခ§ υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ cancelOperation(_:) தஅૢ࡞ͷड͚ೖΕ
ခ . ခ§ AppKit ڞ௨ͷதஅૢ࡞ υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΞϦςΟΞ தஅૢ࡞ͷड͚ೖΕ cancelOperation(_:)
override func cancelOperation(_ sender: Any?) { // υϥοάॲཧΛதࢭͯ͠ mouseDown(with:) લͷঢ়ଶʹ͢ } ခ . ခ§ ϨεϙϯμʔνΣΠϯʹͯ keyDown(with:) Λ͏·͘ύε͠ͳ͍ͱ ॲཧ͞Εͳ͍ՄೳੑΞϦҙ υϥοά&υϩοϓ -
© 2019 Satori Maru / @usagimaruma. #macosnative ΠσΟΦϜ ෳ߹ཁૉ ݪ࢝తཁૉ
جຊૢ࡞ͱ ϑΟʔυόοΫ ͷΈ Ұൠతͳೖग़ྗૢ࡞ه߸ྨ ݪ࢝తཁૉΛΈ߹Θͤͨͷ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛΈ߹Θͤͨͷ ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺඌߴ߂ ༁ ೖྗ ग़ྗ গͳ͍छྨ ؆୯ͳૢ࡞ํ๏ େ ͖ ͳ ޮ Ռ -
© 2019 Satori Maru / @usagimaruma. #macosnative ෳ߹ཁૉ ݪ࢝తཁૉ جຊૢ࡞ͱ
ϑΟʔυόοΫ ͷΈ Ұൠతͳೖग़ྗૢ࡞ه߸ྨ ݪ࢝తཁૉΛΈ߹Θͤͨͷ ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺඌߴ߂ ༁ ೖྗ ग़ྗ গͳ͍छྨ ؆୯ͳૢ࡞ํ๏ େ ͖ ͳ ޮ Ռ ΠσΟΦϜ ΠϯλʔϑΣΠεݻ༗ͷίϚϯυͱϑΟʔυόοΫ ϢʔβʔͷߦಈύλʔϯΛߟྀͭͭ͠ෳ߹ཁૉΛΈ߹Θͤͨͷ -
© 2019 Satori Maru / @usagimaruma. #macosnative ෳ߹ཁૉ ݪ࢝తཁૉ جຊૢ࡞ͱ
ϑΟʔυόοΫ ͷΈ Ұൠతͳೖग़ྗૢ࡞ه߸ྨ ݪ࢝తཁૉΛΈ߹Θͤͨͷ ʰAbout Face 3 ΠϯλϥΫγϣϯσβΠϯͷۃҙʱΑΓղऍ Alan Cooper, Robert Reimann, David Cronin ஶɺඌߴ߂ ༁ ೖྗ ग़ྗ গͳ͍छྨ ؆୯ͳૢ࡞ํ๏ େ ͖ ͳ ޮ Ռ macOS ωΠςΟϒΠϯλʔϑΣΠε “Β͠͞”