Slide 1

Slide 1 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ϑΟʔυ΍νϟοτͷ εΫϩʔϧΛશྗͰͳΊΒ͔ʹ͢Δ iOSDC 2019 Lightning Talks September 7, 2019 Hiroshi Shikata Healthcare
 DeNA Co., Ltd. 1

Slide 2

Slide 2 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ηϧͷߴ͞ՄมͷTableView΍CollectionViewΛ࡞Δͱ͖ 2

Slide 3

Slide 3 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. Α͋͘Δߴ͕͞มΘΔηϧͷྫ 3

Slide 4

Slide 4 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ςΩετͷจࣈ਺ʹΑͬͯߴ͕͞มΘΔ 4

Slide 5

Slide 5 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. UITableViewͰηϧͷߴ͞Λࣗಈʹઃఆ 5

Slide 6

Slide 6 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. දࣔͯ͠ 6

Slide 7

Slide 7 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ҰؾʹεΫϩʔϧ͍ͯ͘͠ͱ 7

Slide 8

Slide 8 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. Ҿ͔͔ͬΔͱ͖͕͋Δ 8 Ψο

Slide 9

Slide 9 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ͳʹ͕ى͍ͬͯ͜Δͷ͔ Cell Cell Cell දࣔதͷηϧ

Slide 10

Slide 10 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ͳʹ͕ى͍ͬͯ͜Δͷ͔ Cell Cell Cell Cell දࣔதͷηϧ εΫϩʔϧ Cell Prefetchର৅ʹͳͬͨηϧ ࣍ʹදࣔ͞ΕΔηϧ

Slide 11

Slide 11 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ͳʹ͕ى͍ͬͯ͜Δͷ͔ Cell Cell Cell Cell දࣔதͷηϧ 1.Cellͷੜ੒ tableView(_:cellForRowAt:) Cell Prefetchର৅ʹͳͬͨηϧ ࣍ʹදࣔ͞ΕΔηϧ

Slide 12

Slide 12 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ͳʹ͕ى͍ͬͯ͜Δͷ͔ Cell Cell Cell Cell දࣔதͷηϧ ࣍ʹදࣔ͞ΕΔηϧ 1.Cellͷੜ੒ tableView(_:cellForRowAt:) 2.Cellͷඳը tableView(_:willDisplay:) 3. CellͷϨΠΞ΢τ Cell Prefetchର৅ʹͳͬͨηϧ

Slide 13

Slide 13 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ͳʹ͕ى͍ͬͯ͜Δͷ͔ Cell Cell Cell Cell දࣔதͷηϧ ࣍ʹදࣔ͞ΕΔηϧ 1.Cellͷੜ੒ tableView(_:cellForRowAt:) 2.Cellͷඳը tableView(_:willDisplay:) 3. CellͷϨΠΞ΢τ Cell Prefetchର৅ʹͳͬͨηϧ ߴࣗ͞ಈܭࢉͷ৔߹͸ ͜ͷؒʹηϧͷߴ͕͞ܭࢉ͞ΕΔ

Slide 14

Slide 14 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. FacebookͷதͷਓʹΑΔFacebookλΠϜϥΠϯͷٕज़ղઆ(2012) Ҿ༻: https://www.facebook.com/notes/facebook-engineering/under-the-hood-mobile-timeline/10150500366118920/

Slide 15

Slide 15 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. FacebookͷதͷਓʹΑΔFacebookλΠϜϥΠϯͷٕज़ղઆ(2012) ■ ϋʔυ΢ΣΞΞΫηϥϨʔγϣϯͷ࠷దԽ ■ σβΠϯͷ޻෉ ͳͲ ʢը૾දࣔʹؔ͢Δ෦෼͔Βൈਮʣ ௨৴ϦΫΤετͷϢʔβΤʔδΣϯτ͔ΒσόΠ εͷ෺ཧతͳԣ෯Λܾఆ͠ɺͦͷԣ෯Λ࢖༻ͯ͠ ϖʔδ্ͷ͢΂ͯͷը૾ͷදࣔαΠζΛܾఆ͢Δ Ҿ༻: https://www.facebook.com/notes/facebook-engineering/under-the-hood-mobile-timeline/10150500366118920/

Slide 16

Slide 16 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. FacebookͷதͷਓʹΑΔFacebookλΠϜϥΠϯͷٕज़ղઆ(2012) ■ ϋʔυ΢ΣΞΞΫηϥϨʔγϣϯͷ࠷దԽ ■ σβΠϯͷ޻෉ ͳͲ ʢը૾දࣔʹؔ͢Δ෦෼͔Βൈਮʣ ௨৴ϦΫΤετͷϢʔβΤʔδΣϯτ͔ΒσόΠ εͷ෺ཧతͳԣ෯Λܾఆ͠ɺͦͷԣ෯Λ࢖༻ͯ͠ ϖʔδ্ͷ͢΂ͯͷը૾ͷදࣔαΠζΛܾఆ͢Δ →ίϯςϯπͷදࣔαΠζ͸αʔόͰܭࢉࡁΈ Ҿ༻: https://www.facebook.com/notes/facebook-engineering/under-the-hood-mobile-timeline/10150500366118920/

Slide 17

Slide 17 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ࣄલʹίϯςϯπͷαΠζΛܭࢉ͓ͯ͘͠ 17

Slide 18

Slide 18 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ࣄલʹίϯςϯπͷදࣔαΠζΛܭࢉ͓ͯ͘͠ Cell Cell Cell TableView σʔλऔಘ & දࣔαΠζܭࢉ දࣔσʔλ&CellSize εΫϩʔϧલʹߴ͞͸͢΂ܾͯ·͍ͬͯΔ

Slide 19

Slide 19 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ෯ͱදࣔ͢ΔςΩετ͕ܾ·Ε͹ߴ͞͸ࢉग़Ͱ͖Δ 19 ςΩετͷจࣈ਺ʹΑͬͯߴ͕͞มԽ

Slide 20

Slide 20 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ෯ͱςΩετ͕ܾ·Ε͹ߴ͞͸ࢉग़Ͱ͖Δ 20 ■ UILabel/UITextField / UITextViewͳͲUIViewΛܧঝͨ͠Class ■ NSAttributedString

Slide 21

Slide 21 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. TableViewCellͱUILabelͷྫ 21 1.UILabelͷԣ෯ΛܾΊΔ TableViewͷԣ෯ - ࠨӈϚʔδϯ TableViewͷԣ෯

Slide 22

Slide 22 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. TableViewCellͱUILabelͷྫ 22 1. UILabelͷԣ෯ΛܾΊΔ TableViewͷԣ෯ - ࠨӈϚʔδϯ 2. UILabelͷαΠζΛࢉग़͢Δ 1ͷԣ෯Λࢦఆͯ͠ func sizeThatFits(_ size: CGSize) -> CGSize

Slide 23

Slide 23 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. ෯ͱදࣔ͢ΔςΩετ͕ܾ·Ε͹ߴ͞͸ࢉग़Ͱ͖Δ 23 1. UILabelͷԣ෯ΛܾΊΔ TableViewͷԣ෯ - ࠨӈϚʔδϯ 2. UILabelͷαΠζΛࢉग़͢Δ 1ͷԣ෯Λࢦఆͯ͠ func sizeThatFits(_ size: CGSize) -> CGSize 3. Cellͷߴ͞Λࢉग़͢Δ 2Ͱܭࢉͨ͠ߴ͞ + ্ԼϚʔδϯ

Slide 24

Slide 24 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. tableView(_:cellForRowAt:) → ϨΠΞ΢τߋ৽׬ྃ·Ͱͷੑೳൺֱ 24 ߴࣗ͞ಈܭࢉͷ৔߹ ߴ͞Λࣄલʹܭࢉ ฏۉ (ϨΠΞ΢τߋ৽׬ྃ·Ͱ) ࠷େ (ϨΠΞ΢τߋ৽׬ྃ·Ͱ)

Slide 25

Slide 25 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. tableView(_:cellForRowAt:) → ϨΠΞ΢τߋ৽׬ྃ·Ͱͷੑೳൺֱ 25 ߴࣗ͞ಈܭࢉͷ৔߹ ߴ͞Λࣄલʹܭࢉ ฏۉ (ϨΠΞ΢τߋ৽׬ྃ·Ͱ) 14ms ࠷େ (ϨΠΞ΢τߋ৽׬ྃ·Ͱ) 95ms

Slide 26

Slide 26 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. tableView(_:cellForRowAt:) → ϨΠΞ΢τߋ৽׬ྃ·Ͱͷੑೳൺֱ 26 ߴࣗ͞ಈܭࢉͷ৔߹ ߴ͞Λࣄલʹܭࢉ ฏۉ (ϨΠΞ΢τߋ৽׬ྃ·Ͱ) 14ms 2ms ࠷େ (ϨΠΞ΢τߋ৽׬ྃ·Ͱ) 95ms 3ms

Slide 27

Slide 27 text

Copyright (C) 2018 DeNA Co.,Ltd. All Rights Reserved. tableView(_:cellForRowAt:) → ϨΠΞ΢τߋ৽׬ྃ·Ͱͷੑೳൺֱ 27 ߴࣗ͞ಈܭࢉͷ৔߹ ߴ͞Λࣄલʹܭࢉ ฏۉ (ϨΠΞ΢τߋ৽׬ྃ·Ͱ) 14ms 2ms ࠷େ (ϨΠΞ΢τߋ৽׬ྃ·Ͱ) 95ms 3ms λΠϜϥΠϯ΍νϟοτ͕ΞϓϦͷίΞػೳͳΒؤுΔՁ஋͸͋Δʂ