Slide 1

Slide 1 text

͋ͳͨͷ஌Βͳ͍6*,JUͷੈք

Slide 2

Slide 2 text

id:cockscomb Ճ౻ਘथ גࣜձࣾ͸ͯͳ ԿΒ͔ͷࣗݾ঺հ

Slide 3

Slide 3 text

6*5BCMF7JFXʹ 6*5FYU7JFXΛஔ͖͍ͨ

Slide 4

Slide 4 text

6*5FYU7JFXͰจࣈΛೖྗ 6*5BCMF7JFXͰෳ਺ͷೖྗཝ

Slide 5

Slide 5 text

6*5FYU7JFXͱ"VUP-BZPVU

Slide 6

Slide 6 text

let textView = UITextView() textView.text = "Think different" textView.intrinsicContentSize() // {w -1 h -1}

Slide 7

Slide 7 text

let textView = UITextView() textView.text = "Think different" textView.intrinsicContentSize() // {w -1 h -1} textView.scrollEnabled = false textView.intrinsicContentSize() // {w 86 h 30}

Slide 8

Slide 8 text

6*5BCMF7JFXͱ"VUP-BZPVU

Slide 9

Slide 9 text

UITableViewCell UITextView

Slide 10

Slide 10 text

UITableViewCell UITextView

Slide 11

Slide 11 text

override func tableView(tableView: UITableView, estimatedHeightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return 200 } override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { return UITableViewAutomaticDimension }

Slide 12

Slide 12 text

6*5BCMF7JFX$FMMͷߴ͞

Slide 13

Slide 13 text

UITableView.beginUpdates() Discussion Call this method if you want subsequent insertions, deletion, and selection operations (for example, cellForRowAtIndexPath: and indexPathsForVisibleRows) to be animated simultaneously. You can also use this method followed by the endUpdates method to animate the change in the row heights without reloading the cell. This group of methods must conclude with an invocation of endUpdates. These method pairs can be nested. If you do not make the insertion, deletion, and selection calls inside this block, table attributes such as row count might become invalid. You should not call reloadData within the group; if you call this method within the group, you must perform any animations yourself.

Slide 14

Slide 14 text

UITableView.beginUpdates() Discussion Call this method if you want subsequent insertions, deletion, and selection operations (for example, cellForRowAtIndexPath: and indexPathsForVisibleRows) to be animated simultaneously. You can also use this method followed by the endUpdates method to animate the change in the row heights without reloading the cell. This group of methods must conclude with an invocation of endUpdates. These method pairs can be nested. If you do not make the insertion, deletion, and selection calls inside this block, table attributes such as row count might become invalid. You should not call reloadData within the group; if you call this method within the group, you must perform any animations yourself.

Slide 15

Slide 15 text

extension ViewController: UITextViewDelegate { func textViewDidChange(textView: UITextView) { UIView.performWithoutAnimation { self.tableView.beginUpdates() self.tableView.endUpdates() } } }

Slide 16

Slide 16 text

͋ͳͨͷ஌Βͳ͍6*,JUͷੈք w 6*5FYU7JFXͷεΫϩʔϧͱJOUSJOTJDDPOUFOUTJ[F w 6*5BCMF7JFXͷ"VUP-BZPVU w 6*5BCMF7JFXʹDFMMͷߴ͞Λ࠶ܭࢉͤ͞Δํ๏