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

Life of a Cell

Johnlin
October 20, 2018

Life of a Cell

iPlayground 2018

Johnlin

October 20, 2018
Tweet

More Decks by Johnlin

Other Decks in Programming

Transcript

  1. Cell (໊ࢺ) • ᄸਓ࿚๪ɼখन๪ʀʢमಓӃతʣᄸਓখࣨ • A small compartment in a

    larger structure such as a honeycomb. • େ૊৫தతҰݸᘐཱ૊੒ᄸݩ
  2. MacPaint.p PROCEDURE DrawPat; VAR i,h: INTEGER; tempRect: Rect; savePort: GrafPtr;

    BEGIN GetPort(savePort); SetPort(@deskWind); OffsetRect(patRect,1,1); PaintRect(patRect); OffsetRect(patRect,-1,-1); EraseRect(patRect); FrameRect(patRect);
  3. MacPaint.p h := patStart; FOR i := 0 TO patRow-1

    DO BEGIN tempRect.left := h; h := h + patSpace; tempRect.right := h - 1; tempRect.top := patTop+1; tempRect.bottom := patMid; FillRect(tempRect,patterns[i]); tempRect.top := patMid + 1; tempRect.bottom := patBottom-1; FillRect(tempRect,patterns[i+patRow]); END; SetPort(savePort);
  4. PROCEDURE ProcessTheEvent; VAR where: Point; menuResult: LongInt; i: INTEGER; code:

    INTEGER; whichWindow: WindowPtr; ... BEGIN IF PtInRect(theEvent.where,toolRect) THEN ChooseTool(theEvent.where); IF PtInRect(theEvent.where,lineRect) THEN ChooseLine(theEvent.where); IF PtInRect(theEvent.where,patRect) THEN ChoosePat(theEvent.where); MacPaint.p
  5. ̢acPaint • ༻ Pascal ౥഑ Assembly ሜత • Ұڞ 10250

    ߦఔࣜᛰ • ௒ڃఈ૚ • ಹݸ೥୅ᔒ༗ॴҦత APIɼ୞༗ System Callɻ
  6. Powerplant • Ұ౟ୈࡾํత GUI Framework ɼ㚎ݐࡏ Code Warrior ཫɻ •

    Ṝݸ࣌ظతඪ४։ᚙ഑උɻ • 㚎ݐॴݟଈॴಘతUI ઃܭ޻۩ɻ
  7. Carbon API • ೺ Ұࠣ OS 8 ೭ޙब༗త API ڈ෥ଘᣰɼแ᧋੒Ұ౟

    APIɻ • ࡏ OS X ্໵ՄҎ䋯Ṝࠣ APIɻ • ᩋᢜతఔࣜՄҎߋ༰қҠ২౸ OS X ্ɻ
  8. ListView in Carbon OSStatus CreateCustomList ( const Rect * rView,

    const ListBounds * dataBounds, Point cellSize, const ListDefSpec * theSpec, WindowRef theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert, ListHandle * outList );
  9. Cocoa API • ኺ NextStep Ҡ২աိతҰ੔౟ GUI Framework • UI

    త෦෼᜝ҝ AppKit • CocoaHeads త༝ိ
  10. NSCell • ᫊ྔత NSView • ᙛ೥iMac G4 ୞༗ 256MB RAM,

    ፤ိ։ Slack ౎ෆⴺɻ • େ෦෼༻ࡏ NSControl
  11. UITableViewDataSource • ኺ 2.0 ޙबᔒ༗վᏓա - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath

    *)indexPath; - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath;
  12. ؆қCell init • ՄҎሣ TableView Ḽ࡭ Cell Class/XIB • dequeue

    త࣌ީՄҎࣗಈ Init Cellɼෆ༻ࣗݾ InitɼᩋେՈ ෆ༻࠶൑Ꮧधෆधཁ Init Cell
  13. ༬ઌᩇऔCell ࢿྉ • UITableViewDataSourcePrefetching • ܥ౷။㢨༗Մೳ။ඃᰖࣔత Cell ݺڣ
 func tableView(_

    tableView: UITableView, prefetchRowsAt indexPaths: [IndexPath]) • ՄҎᩋCellత㚎༰ൺֱૣᰖࣔɻ
  14. Drag & Drop • ࿨Ҏલత moveRowAt ෆಉత஍ํࡏԙՄҎލ App 䇪፮ɼ ࣕ׌ՄҎҰ࣍䇪፮ଟݸ෺݅

    • ࠶໵ෆधཁመ࡞ moveRowAt ɼ୞ཁመ࡞ Drag & Drop ब ޷
  15. Cell is dead, 
 Long live Cell • Cell ኺҰ։࢝తᙘᅷ֨ࢠᎷల౸֤छෆಉత஍ํɼ૾ੋ

    Apple watch ্త Complication • ՄҎ؃౸Cell ຫຫత෼䈚੒ၷछෆಉ༻్ɼՄҎᘐཱӡ࡞ తখݩ݅ɼ҃ੋඃ᧋ࡏ༰ث㚎తݩ݅ɻ