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

NSTextView とは何なのか / What is NSTextView

1024jp
September 08, 2019

NSTextView とは何なのか / What is NSTextView

macOS native symposium (http://macos-native.github.io) #05 登壇資料

AppKitにおいてテキストを表示するビューとして不動の地位を誇るNSTextViewさん。日常的に使う反面、どこかミステリアスな雰囲気で謎に包まれていますよね。どんな性格なの? 年齢は? 家族構成は? 調べてみました。

1024jp

September 08, 2019
Tweet

More Decks by 1024jp

Other Decks in Programming

Transcript

  1. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ࣗݾ঺հ CotEditor Gapplin BathyScaphe

    Qli application work plain-text editor SVG viewer 5ch browser movie player 2014年に
 正式引き継ぎ サポーtメンバー
 (主にデザイン・UI)
  2. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp $PU&EJUPS lightweight plain-text editor


    written in Swift + Cocoa github.com/coteditor NSTextView subclass
  3. macOS native ܹ࿦NBD04$BUBMJOB © 2019 1024jp લճͷ ࣍ճ༧ࠂ 欭 䥛孉勦

    ⬕㔡 㣆↹ /45FYU7JFXͱͦͷϚϧνΧʔιϧ࣮૷ KQ NBD04OBUJWF4ZNQPTJVN 
  4. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ࠓ೔ͷτϐοΫ ѻ͏࿩ – NSTextViewͷཱͪҐஔ

    – NSTextViewͷ͘͠Έ – TextKitͷมભ ѻΘͳ͍࿩ – ϚϧνΧʔιϧ – ΩʔϘʔυೖྗ૚ – λΠϙάϥϑΟ – Core Text
  5. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU,JU "QQ,JU ͦͯ͠ /45FYU7JFX Core

    Graphics TextKit AppKit NSTextView NSTextField NSTextInputContext NSParagraphStyle NSGlyphInfo NSLayoutManager Foundation Core Text UIKit UITextField UITextView UILabel NSSpellChecker UITextInput NSTextAttachment UITextChecker
  6. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYU'JFME ͱ /45FYU7JFX ௕จςΩετ Lorem ipsum

    dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor NSTextView NSTextView NSTextField ୹จςΩετ දࣔ ೖྗ ΖΕΉ͍΀͞m NSTextView ラベルや表のセル、一行の入力欄など 文書や複数行のテキストなど Name: Clarus Clarus Name: field editor
  7. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ςΩετฤूͷػೳΛఏڙ͢ΔͨΊʹɺ
 ฤू༻ͷϏϡʔ ϑΟʔϧυΤσΟλ ͕

    ϏϡʔώΤϥϧΩʔʹࠩ͠ࠐ·ΕΔɻ ΢Πϯυ΢͕͚ͭͩ
 ϑΟʔϧυΤσΟλΛ࣋ͭ ෳ਺ͷςΩετೖྗཝ͕
 ಉ࣌ʹฤूঢ়ଶʹͳΔ͜ͱ͸͋Γಘͳ͍ ϑΟʔϧυΤσΟλ NSTextFieldを編集するときだけ現れる不思議なビュー NSTextView NSTextField 35 Species: Age: Barks: Clarus Moof! Characteristic: Kawaii dogcow field editor Field Editor = First Responder しんどい
  8. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYU7JFX ͷͭͷ໾ׂ ςΩετσʔλͷϏϡʔ ϑΟʔϧυΤσΟλ Moof!

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor heavy-weight ͳ ೖྗΛड͚Δ
  9. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU,JU ただし 仕組みは同一ではない NBD04J04UW04ʹ


    ଘࡏ ಠཱͨ͠GSBNFXPSLͰ͸ͳ͘ "QQ,JU6*,JUͷҰ෦ 5FYU7JFXΛච಄ͱͨ͠ ςΩετೖग़ྗ·ΘΓͷ
 Ϋϥεͷू߹ମ 範囲があいまい
  10. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp J04UW04 ʹ͓͚Δ 5FYU7JFX NSTextStorage NSLayoutManager NSTextContainer

    CoreText UITextView スタイル付き
 テキストデータ テキストデータを
 表示空間に割り付ける テキスト表示空間 ユーザとのやり取り 入力 実際の描画計算 ref. “Getting to Know TextKit” (2013) by Max Seelemann @Ulysses https://www.objc.io/issues/5-ios7/getting-to-know-textkit/ View Model Model Controller Pr UITextInput
  11. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp NBD04 ʹ͓͚Δ 5FYU7JFX NSTextStorage NSLayoutManager NSTextContainer

    CoreText NSTextView NSTextInputContext NSTypesetter NSGlyphGenerator スタイル付き
 テキストデータ テキストデータを
 表示空間に割り付ける ユーザとのやり取り 入力 各行にグリフを流し込む グリフを生成 テキスト表示空間 ref. “Getting to Know TextKit” (2013) by Max Seelemann @Ulysses https://www.objc.io/issues/5-ios7/getting-to-know-textkit/ View Model Model Controller Controller Controller Pr NSTextInputClient 実際の描画計算
  12. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp J04UW04 ͱ NBD04 ͷҧ͍ 両方TextKitだが、わりと違うものとして扱った方が良い。 (= iOSのTextKitに関するノウハウはあまり役に立たない)

    NSTextStorage NSLayoutManager NSTextContainer CoreText UITextView JOJ04UW04 NSTextStorage NSLayoutManager NSTextContainer CoreText NSTextView NSTextInputContext NSTypesetter NSGlyphGenerator JONBD04
  13. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU,JU ͷྺ࢙ iPhone OS iOS

    3.2 Mac OS X 10.4 1998 macOS (Mac OS X) 2020 2007 iOS TextKitという名称が
 初めて出てくる Mac OS 8.5 2001 2005 2013 2010 Apple Type Services for Unicode Imaging Mac OS Mac OS X 10.0 NSTextView, etc UITextView TextKit CoreText CoreText ATSUI iOS 7
  14. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU7JFXJONBD04 スタイル付き
 テキストデータ テキストデータを


    表示空間に割り付ける ユーザとのやり取り 入力 テキスト表示空間 NSTextStorage NSLayoutManager NSTextContainer NSTextView NSTextInputContext NSTypesetter NSGlyphGenerator View Model Model Controller Controller Controller Pr NSTextInputClient 各行にグリフを流し込む グリフを生成
  15. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU7JFXJONBD04 NSTextStorage NSLayoutManager NSTextContainer

    NSTextView NSTextInputContext NSTypesetter NSGlyphGenerator View Model Model Controller Controller Controller ͜ͷͭͷΫϥε͕ڠۀͯ͠ςΩετͷೖྗ͔Βग़ྗ·Ͱ͕׬݁͢Δɻ → 必要に応じてこれらをサブクラスして使う delegate delegate delegate ・デリゲートを受ける
  16. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ༷ʑͳ֓೦ਤ モデルから出力までの流れを説明 Fig. Text

    object configuration for a single flow of text in Cocoa Text Architecture Guide Appleによる
  17. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ༷ʑͳ֓೦ਤ “Advanced Cocoa Text

    Tips and Tricks” | WWDC2010 Session114 各クラスをModel-View-Controllerで分類して説明 Cocoa Text System The Cocoa Text System helper classes Vi ew Controller Model NSTextView NSLayoutManager NSTextStorage NSTextContainer NSTextAttachment NSGlyphGenerator NSTypesetter Appleによる
  18. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ༷ʑͳ֓೦ਤ 描画におけるそれぞれのクラスの役割を説明 Fig. Composition

    of text display in Text Layout Programming Guide Appleによる We the People of the United We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America. Section 1. All legislative Powers herein granted shall be vested in a Congress of the United States, which shall consist of a Senate and House of We the People of the United Window Glyph generator provides glyphs for characters. Typesetter places glyphs in line fragment rectangles. Text container models area on page to lay out text. Text view displays text within content view and handles user interactions. Window content view
  19. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ༷ʑͳ֓೦ਤ テキストレイアウト時のメソッド呼び出し順序を説明 Fig. The

    text layout process in Text Layout Programming Guide Appleによる anNSTypesetter anNSTextContainer anNSTextStorage anNSTextView r epl ac eChar ac t er s I nRange: wi t h s t r i ng: anNSLayoutManager l ayout Gl yphs I nLayout M anager : s t ar t i ngAt Gl yphI ndex: m axNum ber Of Li neFr agm ent s : next Gl yphI ndex: l i neFr agm ent Rec t For Pr opos edRec t : s weepDi r ec t i on: m ovem ent Di r ec t i on: r em ai ni ngRec t : t ext St or age: edi t ed: r ange: c hangeI nLengt h i nval i dat edRange: 2 3 8 9 s et Needs Di s pl ayI nRec t : avoi dAddi t i onal Layout : 4 6 7 5 1
  20. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ༷ʑͳ֓೦ਤ Cocoa Text System

    The Cocoa Text System helper classes Vi ew Controller Model NSTextView NSLayoutManager NSTextStorage NSTextContainer NSTextAttachment NSGlyphGenerator NSTypesetter Appleによる We the People of the United We the People of the United States, in Order to form a more perfect Union, establish Justice, insure domestic Tranquility, provide for the common defence, promote the general Welfare, and secure the Blessings of Liberty to ourselves and our Posterity, do ordain and establish this Constitution for the United States of America. Section 1. All legislative Powers herein granted shall be vested in a Congress of the United States, which shall consist of a Senate and House of We the People of the United Window Glyph generator provides glyphs for characters. Typesetter places glyphs in line fragment rectangles. Text container models area on page to lay out text. Text view displays text within content view and handles user interactions. Window content view anNSTypesetter anNSTextContainer anNSTextStorage anNSTextView r epl ac eChar ac t er s I nRange: wi t h s t r i ng: anNSLayoutManager l ayout Gl yphs I nLayout M anager : s t ar t i ngAt Gl yphI ndex: m axNum ber Of Li neFr agm ent s : next Gl yphI ndex: l i neFr agm ent Rec t For Pr opos edRec t : s weepDi r ec t i on: m ovem ent Di r ec t i on: r em ai ni ngRec t : t ext St or age: edi t ed: r ange: c hangeI nLengt h i nval i dat edRange: 2 3 8 9 s et Needs Di s pl ayI nRec t : avoi dAddi t i onal Layout : 4 6 7 5 1
  21. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ෳ਺ͷ -BZPVU.BOBHFS5FYU$POUBJOFS NSTextStorage NSLayoutManager NSTextContainer

    NSTextView NSTextStorage NSLayoutManager NSTextContainer NSTextView NSTextContainer NSTextView NSTextStorage NSLayoutManager NSTextContainer NSTextView NSLayoutManager NSTextContainer NSTextView Multiple layout managers allow you to have multiple presentations of the same text. The text within each view can have separate layout and selections. Multiple layout managers allow you to have multiple presentations of the same text. The text within each view can have separate layout and selections. With one text view, all of the text flows within a single, typically recutangular, area. As text is added, it fills the recion defined by the first text containers. The text is displayed in the text view that is paired with the text container. When there’s no ⾭ more room, another text container (and associated text view) is added, and the text flows onto the second page. CBTJD NVMUJDPOUBJOFST NVMUJMBZPVU.BOBHFST
  22. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYU7JFX ͷ֎ଆ NSScrollView NSRulerViews NSClipView

    NSTextView NSScrollers Font Panel, etc Interactions – Menu Actions – Keybindings – Find/Replace – Print – … Touch Bar TextView component Inspector Bar
  23. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYU7JFX ͕४ڌ͍ͯ͠Δϓϩτίϧ Responder – NSColorChanging

    – NSDraggingSource – NSUserActivityRestoring Touch Bar – NSTouchBarProvider – NSCandidateListTouchBarItemDelegate – NSTextLayoutOrientationProvider – NSTouchBarDelegate UI Validations – NSUserInterfaceValidations – NSMenuItemValidation Spell Check – NSChangeSpelling – NSIgnoreMisspelledWords Text Typing – NSTextInput (slated for deprecation) – NSTextInputClient – NSAccessibilityNavigableStaticText – NSStandardKeyBindingResponding
  24. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYU7JFX ͷܧঝؔ܎ NSText NSView subclass

    subclass お前だれだ? NSObject NSResponder subclass subclass UITextView UIScrollView UIView subclass subclass NSObject UIResponder subclass subclass 6*5FYU7JFX /45FYU7JFX NSTextView
  25. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYUͱ͸ –NSTextView以外では使われてない –サブクラスもとくに推奨されてない –これだけだと使えない

    AppKit reference (2019/macOS 10.14) Class NSText The most general programmatic interface for objects that manage text. var string: String var isEditable: Bool var isFieldEditor: Bool var baseWritingDirection: NSWritingDirection func replaceCharacters(in: NSRange, with: String) func paste(Any?) func scrollRangeToVisible(NSRange) NSTextͷAPI (ൈਮ) var textStorage var layoutManager var textContainer NSTextViewͷAPI (ൈਮ) NSTextʹͳ͍
  26. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYUͱ͸ Protocol NSTextInputClient A

    set of methods that text views must implement to interact properly with the text input management system. Overview To create another text view class, you can either subclass NSTextView (and not NSText, for historical reasons), or subclass NSView and implement the NSTextInputClient protocol AppKit reference (2019/macOS 10.14) → NSTextInputContextとやり取りできない。 NSTextViewが準拠してるヤツ
  27. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYUͱ͸ 欭 䥛孉勦 ⬕㔡

    㣆↹ (/6TUFQͱ$PDPUSPO KQ NBD04OBUJWF4ZNQPTJVN  “GNUstepͱCocotron”, macOS native Symposium #03 https://speakerdeck.com/1024jp/gnustep-and-cocotron
  28. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /45FYUͱ͸ macOS native (/6TUFQͱ$PDPUSPO

    © 2019 1024jp "QQMJDBUJPO,JU 0QFO4UFQ NSColorList NSObject NSColor NSCell NSColorPicker NSCursor NSDataLink NSDataLinkManager NSEvent NSFont NSFontManager NSImage NSImageRep NSPasteboard NSPrintInfo NSPrintOperation NSPrinter NSResponder NSScreen NSSelection NSSpellChecker NSSpellServer NSWorkspace NSActionCell NSBrowserCell NSBitmapImageRep NSEPSImageRep NSCachedImageRep NSCustomImageRep NSWindow NSApplication NSView NSButtonCell NSFormCell NSSliderCell NSTextFieldCell NSMenuCell NSPanel NSText NSCStringText NSSplitView NSScrollView NSControl NSBox NSClipView NSColorPanel NSDataLinkPanel NSFontPanel NSHelpPanel NSMenu NSPageLayout NSPrintPanel NSSavePanel NSOpenPanel NSTextField NSBrowser NSButton NSColorWell NSMatrix NSScroller NSSlider NSPopUpButton NSForm “GNUstepͱCocotron”, macOS native Symposium #03 https://speakerdeck.com/1024jp/gnustep-and-cocotron ger n NSActionCell NSBrowserCell NSBitmapImageRep NSEPSImageRep NSCachedImageRep NSCustomImageRep NSWindow NSApplication NSView NSButtonCell NSFormCell NSSliderCell NSTextFieldCell NSMenuCell NSPanel NSText NSCStringText NSSplitView NSScrollView NSControl NSBox NSClipView NSColorPanel NSDataLinkPanel NSFontPanel NSHelpPanel NSMenu NSPageLayout NSPrintPanel NSSavePanel NSOpenPanel NSTextField NSBrowser NSButton NSColorWell NSMatrix NSScroller NSSlider NSPopUpButton NSForm  0QFO4UFQ NSActionCell NSBrowserCell NSBitmapImageRep NSEPSImageRep NSCachedImageRep NSCustomImageRep NSWindow NSApplication NSView NSButtonCell NSFormCell NSSliderCell NSTextFieldCell NSMenuCell NSPanel NSText NSCStringText NSSplitView NSScrollView NSControl NSBox NSClipView NSColorPanel NSDataLinkPanel NSFontPanel NSHelpPanel NSMenu NSTextField NSBrowser NSButton NSColorWell NSMatrix NSScroller NSSlider NSPopUpButton NSForm 0QFO4UFQ ޙظNeXT༻ϑϨʔϜϫʔΫɻ چNeXTSTEPɻ
  29. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp NSText Inherits From: NSView

    : NSResponder : NSObject Conforms To: NSChangeSpelling, NSIgnoreMisspelledWords NSCoding (NSResponder) NSObject (NSObject) Declared In: AppKit/NSTextView.h Class Description The NSText class declares the programmatic interface to objects that manage text. NSText objects are used by the Application Kit wherever text appears in interface objects: An NSText object draws the title of a window, the commands in a menu, the title of a button, and the items in a browser. Your application inherits these uses of the NSText class when it incorporates any of these objects into its interface. Your application can also create NSText objects for its own purposes. The NSText class is unlike most other classes in the Application Kit in its complexity and range of features. One of its design goals is to provide a comprehensive set of text-handling features so that you’ll rarely need to create a subclass. An NSText object can (among other things): • Control the color of its text and background. • Control the font and layout characteristics of its text. /45FYUͱ͸ OpenStep specification (1994)
  30. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp Class NSText The NSText

    class declares
 the programmatic interface to objects that manage text. Class NSText The most general programmatic interface for objects that manage text. /45FYUͱ͸ AppKit reference (2019) OpenStep specification (1994)
  31. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp NSText Inherits From: NSView

    : NSResponder : NSObject Conforms To: NSChangeSpelling, NSIgnoreMisspelledWords NSCoding (NSResponder) NSObject (NSObject) Declared In: AppKit/NSTextView.h Class Description The NSText class declares the programmatic interface to objects that manage text. NSText objects are used by the Application Kit wherever text appears in interface objects: An NSText object draws the title of a window, the commands in a menu, the title of a button, and the items in a browser. Your application inherits these uses of the NSText class when it incorporates any of these objects into its interface. Your application can also create NSText objects for its own purposes. The NSText class is unlike most other classes in the Application Kit in its complexity and range of features. One of its design goals is to provide a comprehensive set of text-handling features so that you’ll rarely need to create a subclass. An NSText object can (among other things): • Control the color of its text and background. • Control the font and layout characteristics of its text. OpenStep specification (1994) /45FYUͱ͸ !? –NSTextサブクラスであるNSCStringTextのAPIはNSTextViewとあまり似ていない。 –OpenStepの仕様書にNSTextViewは存在しないが…
  32. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /F9545&1 ͷόʔδϣϯวྺ 1989 1997 1993

    1991 1995 1992 1990 1994 1996 NeXTSTEP OPENSTEP 1998 1.0 2.0 3.0 ࢓༷ॻ 4.0 Sun Microsystemsと
 NeXTが提携 NeXT買収 Rhapsody開発版リリース NSText.h /* NSText.h Application Kit Copyright (c) 1994-2018, Apple Inc. All rights reserved. */ (AppKit) 3.3 4.2
  33. macOS native (/6TUFQͱ$PDPUSPO © 2019 1024jp "QQMJDBUJPO,JU 0QFO4UFQESBGU NSCell NSWorkspace

    NSActionCell NSBrowserCell NSBitmapImageRep NSEPSImageRep NSWindow NSApplication NSView NSButtonCell NSTextFieldCell NSMenuCell NSPanel NSText NSCStringText NSBox NSColorPanel NSMenu NSPageLayout NSPrintPanel NSSavePanel NSOpenPanel NSTextField NSBrowser NSMatrix NSPopUpButton NSForm NSFormCell NSSliderCell NSCachedImageRep NSCustomImageRep NSClipView NSControl NSScrollView NSSplitView NSColorList NSColor NSColorPicker NSCursor NSDataLink NSDataLinkManager NSEvent NSFont NSFontManager NSImage NSImageRep NSPasteboard NSPrintInfo NSPrintOperation NSPrinter NSResponder NSScreen NSSelection NSSpellChecker NSSpellServer NSButton NSColorWell NSScroller NSSlider NSDataLinkPanel NSFontPanel NSHelpPanel #03 再掲 NSObject
  34. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp "QQMJDBUJPO,JU 0QFO4UFQ NSCell NSSpellServer

    NSActionCell NSBitmapImageRep NSEPSImageRep NSWindow NSApplication NSView NSButtonCell NSTextFieldCell NSPanel NSText NSCStringText NSSplitView NSScrollView NSControl NSBox NSClipView NSColorPanel NSPageLayout NSSavePanel NSOpenPanel NSTextField NSBrowser NSColorWell NSMatrix NSPopUpButton NSForm NSFormCell NSSliderCell NSCachedImageRep NSCustomImageRep NSColorList NSColor NSColorPicker NSCursor NSDataLink NSDataLinkManager NSEvent NSObject NSPrintOperation NSPrinter NSResponder NSSelection NSScroller NSSlider NSPrintPanel NSDataLinkPanel NSFontPanel NSTextView NSTextAttachmentCell NSComboBoxCell NSTableHeaderCell NSRulerView NSTableHeaderView NSComboBox NSSecureTextField NSTableView NSDPSContext NSDPSServerContext NSFileWRapper NSInputManager NSInputServer NSMenu NSMenuItem NSParagraphStyle NSRulerMarker NSTextStorage NSSecureTextFieldCell NSButton NSImageView NSBrowserCell NSImageCell NSFont NSFontManager NSImage NSImageRep NSPasteboard NSSpellChecker NSScreen NSPrintInfo NSMutableAttributedString NSTableColumn NSTextContainer NSTextTab NSTextAttachment NSWorkspace OpenStep 4.0Ͱ௥Ճ/มߋ OpenStep draftʹଘࡏ NSWindowサブクラスから
 NSObject下に移動 NSLayoutManager
  35. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 01&/45&1 Ҏલ r /4QSFpY͕෇Ճ r

    /45FYU7JFXొ৔ r 0CKFDUJWF$ r ΦϒδΣΫτࢦ޲ 新 NeXTSTEP 1.0-3.3 OPENSTEP 4.x macOS 10.0 –
  36. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp "QQMJDBUJPO,JU /F9545&1 Cell ActionCell

    SelectionCell Window Application View ButtonCell TextFieldCell MenuCell Panel Text Box FontPanel Menu PageLayout PrintPanel SavePanel OpenPanel TextField Matrix PopUpList Form FormCell SliderCell Control ScrollView Bitmap Font FontManager Listener Pasteboard PrintInfo Responder Speaker Button Scroller Slider ChoosePrinter Object Cursor OpenStep draftʹ͸ଘࡏ͠ͳ͍ OpenStep draftʹଘࡏ ClipView
  37. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp "QQMJDBUJPO,JU /F9545&1 Cell ActionCell

    SelectionCell Window Application View ButtonCell TextFieldCell MenuCell Panel Text Box FontPanel Menu PageLayout PrintPanel SavePanel OpenPanel TextField Matrix PopUpList Form FormCell SliderCell Control ScrollView Font FontManager Listener Pasteboard PrintInfo Responder Speaker Button Scroller Slider Object NeXTSTEP 2.0–3.3Ͱ௥Ճ NXColorPicker NXColorList NXCursor NXImage NXImageRep NXDataLink NXDataLinkManager NXSelection NXJournaler NXSpellChecker NXSpellServer NXBrowserCell NXBitmapImageRep NXCachedImageRep NXEPSImageRep NXCustomImageRep NXSplitView ClipView NXColorWell NXBrowser NXHelpPanel NXDataLinkPanel NXColorPanel
  38. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU Ϋϥε -setText:(const char*)string -(BOOL)isEditable

    -(float)backgroundGray -(id)delegate -replaceSel:(const char*)string
 -setSel:(int)start :(int)end -paste:(id)sender -sizeToFit -scrollSelToVisible -setString:(NSString*)string -(BOOL)isEditable -(NSColor*)backgroundColor -(id<NSTextDelegate>)delegate -replaceCharactersInRange:(NSRange)range
 withString:(NSString*)str -setSelectedRange:(NSRange)range -paste:(id)sender -sizeToFit -scrollRangeToVisible:(NSRange)range ref. “Text class” (1989) http://lisp.hopto.org/Documentation/NEXTSTEP-1.0/NeXT/SysRefMan/22_ClassSpecs/AppKit/Text.htmld/ NSText class Text class NeXTSTEP 1.0 – 3.3 OPENSTEP 4.0 – macOS 10.14
  39. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU Ϋϥε NeXTSTEP 1.0 –

    3.3 OPENSTEP 4.0 – macOS 10.14 ref. “Window class” (1989) http://lisp.hopto.org/Documentation/NEXTSTEP-1.0/NeXT/SysRefMan/22_ClassSpecs/AppKit/Window.htmld/ -(Text*)getFieldEditor:(BOOL)create
 for:(id)anObject -(NSText*)fieldEditor:(BOOL)createFlag
 forObject:(id)object -textDidChange:(Text*)textObject -textDidEnd:(Text*)textObject
 endChar:(unsigned short)whyEnd -textDidChange:(NSNotification*)note -textDidEndEditing:(NSNotification*)note a movement character
 (Tab, Shift-Tab, or Return) (userInfo: NSTextMovementUserInfoKey) NSTextDelegate protocol Text delegate NSWindow class Window class
  40. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 01&/45&1 Ҏલ r /4QSFpY͕෇Ճ r

    /45FYU7JFXొ৔ r 0CKFDUJWF$ r ΦϒδΣΫτࢦ޲ 新 NeXTSTEP 1.0-3.3 OPENSTEP 4.x macOS 10.0 – r 5FYUΫϥε͸طʹଘࡏ r 4DSPMM7JFXʹೖΕͯ5FYUΛར༻͢Δ r ϑΟʔϧυΤσΟλ (NS)Textこそが“Text”のクラス r /9QSFpY͕෇Ճ
  41. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp /F95 ͔Β $PDPB ΁ ref. “The OPENSTEP

    Text System” (1997) http://lisp.hopto.org/Documentation/OPENSTEP/NextDev/ TasksAndConcepts/ProgrammingTopics/TextOverview.htmld/ ref. “Cocoa Text Architecture Guide” (2012) https://developer.apple.com/library/archive/documentation/ TextFonts/Conceptual/CocoaTextArchitecture/ TextSystemArchitecture/ArchitectureOverview.html $PDPB5FYU4ZTUFN 01&/45&15FYU4ZTUFN 現在のTextKitの仕組みはNeXTの時点で完成されていた ͍͍࿩ʂ Ϋ˓ϨΨγʔ
 ͡ΌͶ͔͐ʜ ރΕͯΔ͎ʂ
  42. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU,JU ͷྺ࢙ iPhone OS iOS

    3.2 Mac OS X 10.4 iOS 7 1998 macOS (Mac OS X) 2020 2007 iOS TextKitという名称が
 初めて出てくる Mac OS 8.5 2001 2005 2013 2010 Apple Type Services for Unicode Imaging Mac OS Mac OS X 10.0 NSTextView, etc UITextView TextKit CoreText CoreText ATSUI ࠶ܝ
  43. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU,JU ͷྺ࢙ iPhone OS iOS

    3.2 Mac OS X 10.4 iOS 7 1998 macOS (Mac OS X) 2007 iOS TextKitという名称が
 初めて出てくる Mac OS 8.5 2001 2005 2013 2010 Apple Type Services for Unicode Imaging Mac OS Mac OS X 10.0 NSTextView, etc UITextView TextKit CoreText CoreText ATSUI NeXTSTEP OPENSTEP 4.0 NSTextView, etc 1996 NeXTSTEP 1.0 Text 1989 ׬શ൛ 2020 NSTextの前身 かつfield editorの祖
  44. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp 5FYU,JU ·ͱΊ – CocoaͷςΩετγεςϜ͸NeXTSTEP༝དྷͰ͋Γ1989೥·ͰḪΕΔ –

    TextKit͸Cocoaʹ͓͍ͯςΩετͷϞσϧ͔ΒϏϡʔ·Ͱఏڙ͢Δ ϓϥοτϑΥʔϜϨϕϧͷγεςϜͰ͋Δ – iOS/tvOSͷTextKitͱmacOSͷTextKit͸͍ͩͿҧ͏ – NSTextView͸ओʹҎԼͷ6ͭͷΫϥε͔Β੒Γཱͭɿ NSTextStorage NSLayoutManager NSTextContainer CoreText NSTextView NSTextInputContext NSTypesetter NSGlyphGenerator
  45. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ࢀߟจݙ API Reference –

    TextKit | Apple Developer Documentation (2019) https://developer.apple.com/documentation/appkit/textkit Documentation – Cocoa Text Architecture Guide (2014) https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/ CocoaTextArchitecture/ – Text Layout Programming Guilde (2003, 2014) https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextLayout/ – Text System User Interface Layer Programming Guide (1997, 2012) https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/TextUILayer/ – Text System Storage Layer Overview (1997, 2012) https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ TextStorageLayer/ Source Code – TextEdit | Apple Developer Documentation (2013) https://developer.apple.com/library/archive/samplecode/TextEdit/ archived archived Apple
  46. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ࢀߟจݙ Video – Session

    114: Advanced Cocoa Text Tips and Tricks | WWDC 2010 (2010) https://developer.apple.com/devcenter/download.action?path=/videos/wwdc_2010__hd/ session_114__advanced_cocoa_text_tips_and_tricks.mov – Session 221: TextKit Best Practices | WWDC 2018 (2018) https://developer.apple.com/videos/play/wwdc2018/221/ Apple
  47. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ࢀߟจݙ API Reference –

    OpenStep Specification (1994) http://www.gnustep.org/resources/OpenStepSpec.pdf.gz – AppKit Class in NeXTSTEP 1.0 (1989) http://lisp.hopto.org/Documentation/NEXTSTEP-1.0/NeXT/SysRefMan/22_ClassSpecs/AppKit/ – AppKit Classes in OPENSTEP (1996) http://lisp.hopto.org/Documentation/OPENSTEP/NextDev/Reference/AppKit/Classes/ Article – The OPENSTEP Text System (1997) http://lisp.hopto.org/Documentation/OPENSTEP/NextDev/TasksAndConcepts/ ProgrammingTopics/TextOverview.htmld/ Book – NeXtstep Programming: Step One: Object-Oriented Applications (1993) by Simson L. Garfinkel, Michael K. Mahoney Article – Porting NEXTSTEP3.2/3.3 Applications to OpenStep on Solaris (1997) http://www.nextcomputers.org/NeXTfiles/Docs/Software/OPENSTEP/802-2115.pdf NeXT SunSoft
  48. macOS native /45FYU7JFX ͱ͸Կͳͷ͔ © 2019 1024jp ࢀߟจݙ Source Code –

    gnustep/libs-gui (2019) https://github.com/gnustep/libs-gui Article – Getting to Know TextKit (2013) https://www.objc.io/issues/5-ios7/getting-to-know-textkit/ Article – NeXTSTEP (2019) https://en.wikipedia.org/wiki/NeXTSTEP GNUstep objc.io wikipedia