Slide 1

Slide 1 text

͍·͔Β࢖͑Δ SpreadsheetView potatotips #40 at Retty Wednesday May 24th 2017

Slide 2

Slide 2 text

Satoshi Hachiya Twitter: @jpmartha_jp • ฌݿݝਆށࢢࡏॅ • iOS ΤϯδχΞ / ίϛϡχςΟӡӦ • ౦ژͰ ʮPlayer!ʯͷ։ൃ • ࠃࡍΧϯϑΝϨϯεʮtry! Swift Tokyoʯɺʮtry! Swift NYCʯͳͲ

Slide 3

Slide 3 text

kishikawakatsumi/SpreadsheetView • ެ։ޙ 13 ೔Ͱ໿ 1,500 ελʔ֫ಘ ✨ • ͬͦ͘͞εέδϡʔϧදΛ࡞ͬͯΈ·ͨ͠ "

Slide 4

Slide 4 text

ࠓճ࡞ͬͨ؆қΞϓϦ ʢ৭࢖͍͸๻ͷηϯεͰ͢ !ʣ

Slide 5

Slide 5 text

Features (1/3) • Fixed column and row headers • ϔομݻఆ • Merge cells • ηϧͷ݁߹

Slide 6

Slide 6 text

Features (2/3) • Circular infinite scrolling automatically • ॥؀εΫϩʔϧ • Customize gridlines and borders for each cell • άϦουઢͱ࿮ઢͷΧελϚΠζ • Customize inter cell spacing vertically and horizontally • ಺ଆͷ༨നͷΧελϚΠζ

Slide 7

Slide 7 text

Features (3/3) • Fast scrolling, memory efficient • UICollectionView like API • Well unit tested

Slide 8

Slide 8 text

͋͞࢖ͬͯΈΑ͏ ✊

Slide 9

Slide 9 text

3 ͭͷαϯϓϧ෇͖ • εέδϡʔϧ • Ψϯτνϟʔτ • λΠϜςʔϒϧ

Slide 10

Slide 10 text

UICollectionView ͷΑ͏ͳ API func numberOfColumns(in spreadsheetView: SpreadsheetView) -> Int func numberOfRows(in spreadsheetView: SpreadsheetView) -> Int func spreadsheetView(_ spreadsheetView: SpreadsheetView, cellForItemAt indexPath: IndexPath) -> Cell?

Slide 11

Slide 11 text

Merge cells

Slide 12

Slide 12 text

Θ͔Γ΍͍͢Α͏୯७ʹ͠·ͨ͠ func mergedCells(in spreadsheetView: SpreadsheetView) -> [CellRange] { return [ CellRange(from: (row: 0, column: 1), to: (row: 0, column: 2)), CellRange(from: (row: 0, column: 3), to: (row: 0, column: 4)), CellRange(from: (row: 2, column: 0), to: (row: 13, column: 0)), CellRange(from: (row: 14, column: 0), to: (row: 25, column: 0)), CellRange(from: (row: 26, column: 0), to: (row: 37, column: 0)), CellRange(from: (row: 38, column: 0), to: (row: 49, column: 0)), CellRange(from: (row: 50, column: 0), to: (row: 61, column: 0)), CellRange(from: (row: 62, column: 0), to: (row: 73, column: 0)), CellRange(from: (row: 74, column: 0), to: (row: 85, column: 0)), CellRange(from: (row: 86, column: 0), to: (row: 97, column: 0)), CellRange(from: (row: 98, column: 0), to: (row: 109, column: 0)), CellRange(from: (row: 110, column: 0), to: (row: 121, column: 0)), CellRange(from: (row: 122, column: 0), to: (row: 133, column: 0)), CellRange(from: (row: 8, column: 1), to: (row: 22, column: 1)), CellRange(from: (row: 23, column: 1), to: (row: 25, column: 1)) ] }

Slide 13

Slide 13 text

5෼ࠁΈͷηϧΛ࡞ͬͯ݁߹ͤ͞·ͨ͠ !

Slide 14

Slide 14 text

ͯ͞ ΄͔ʹϥΠϒϥϦ͸ʁ !

Slide 15

Slide 15 text

Repository Latest commit Fixed column and row headers Merge cells Star kishikawakatsumi /SpreadsheetView 2017 ✅ ✅ 1,478 stuffrabbit/ SwiftSpreadsheet 2017 ✅ 379 mutualmobile/ MMSpreadsheetVi ew 2013 ✅ 171 darrarski/ DRCollectionView TableLayout-iOS 2015 ✅ 67 ʢ! ௐ΂ʣ

Slide 16

Slide 16 text

!

Slide 17

Slide 17 text

࠷ޙʹʢ·ͩ۷ΓԼ͍͛ͨ಺༰ʣ • Fast scrolling, memory efficient • Well unit tested

Slide 18

Slide 18 text

ͻͱ͚ͭͩྫΛڍ͛Δͱ Binary Searchʢೋ෼୳ࡧʣ

Slide 19

Slide 19 text

raywenderlich/swift-algorithm-club ʹΑΔͱɺ The built-in indexOf() function performs a linear search.

Slide 20

Slide 20 text

͋Γ͕ͱ͏͍͟͝·ͨ͠!